day09_TelevisionTest

육희영·2021년 10월 5일
0
package day09;

public class TelevisionTest {
	public static void main(String[] args) {
		Television tv = new Television();
		tv.channel = 7;
		tv.volume = 9;
		tv.onOff = true;
		System.out.println("텔레비전 채널은 " + tv.channel + "이고 볼륨은 " + tv.volume + "입니다.");
	}
}

class Television {
	int channel; //채널 번호
	int volume; //볼륨
	boolean onOff; //전원 상태
}

출력결과

텔레비전 채널은 7이고 볼륨은 9입니다.

0개의 댓글

관련 채용 정보