class TV{
private int size;
TV(int size) {
this.size=size;
}
protected int getSize() {
return size;
}
}
class ColorTV extends TV{
private int Color;
ColorTV(int size,int Color){
super(size);
this.Color=Color;
}
protected int getColor() {
return Color;
}
void printProperty() {
System.out.println(getSize()+"인치 "+getColor()+"컬러");
}
}
public class TVEX{
public static void main(String[] args) {
ColorTV myTV = new ColorTV(32,1024);
myTV.printProperty();
}
}
class TV{
private int size;
TV(int size) {
this.size=size;
}
protected int getSize() {
return size;
}
}
class ColorTV extends TV{
private int Color;
ColorTV(int size,int Color){
super(size);
this.Color=Color;
}
protected int getColor() {
return Color;
}
}
class IPTV extends ColorTV{
private String ip;
IPTV(String ip,int size,int Color){
super(size,Color);
this.ip=ip;
}
protected String getIP() {
return ip;
}
public void printProperty() {
System.out.println("나의 IPTV는 "+getIP()+" 주소의 "+getSize()+"인치 "+getColor()+"컬러");
}
}
public class IPTVEX {
public static void main(String[] args) {
IPTV iptv = new IPTV("192.1.1.2",32,2048);
iptv.printProperty();
}
}