728x90 자바 class1 [JAVA] ch07-03. 객체 지향 3 public class Ex03 { public static void main(String[] args){ TVCR tvcr = new TVCR(); tvcr.power(); tvcr.play(); tvcr.stop(); System.out.println(tvcr); } } class TVCR extends Tv{ VCR vcr = new VCR(); int counter = vcr.counter; void play(){vcr.play();} void stop(){vcr.stop();} void rew(){vcr.rew();} void ff(){vcr.ff();} } class Tv{ boolean power; int channel; void power(){power = !power;} void chan.. JAVA/예제 2017. 8. 22. 이전 1 다음 728x90