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