package day09;
public class TelevisionTest2 {
public static void main(String[] args) {
Television1 myTv = new Television1();
myTv.channel = 7;
myTv.volume = 10;
myTv.onOff = true;
myTv.print();
Television1 yourTv = new Television1();
yourTv.channel = 9;
yourTv.volume = 12;
yourTv.onOff = true;
yourTv.print();
}
}
class Television2 {
int channel;
int volume;
boolean onOff;
void print() {
System.out.println("채널은 " + channel + "이고 볼륨은 " + volume + "입니다.");
}
int getChannel() {
return channel;
}
}
출력결과
채널은 7이고 볼륨은 10입니다.
채널은 9이고 볼륨은 12입니다.