package tv;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TV {
public String channel;
public String volume;
public String modern;
public String hidup;
public String mati;
public TV(){//membuat intance baru
channel="";
volume="";
modern="";
hidup="";
mati="";
}
public TV (String newChannel, String newVolume, String newModern,
String newHidup, String newMati){
channel=newChannel;
volume=newVolume;
modern=newModern;
hidup=newHidup;
mati=newMati;
}
public void setChannel (String newChannel){
channel=newChannel;
}
public void setVolume (String newVolume){
volume=newVolume;
}
public void setModern (String newModern){
modern=newModern;
}
public void setHidup (String newHidup){
hidup=newHidup;
}
public void setMati (String newMati){
mati=newMati;
}
public String getChannel(){
return channel;
}
public String getVolume(){
return volume;
}
public String getModern(){
return modern;
}
public String getHidup(){
return hidup;
}
public String getMati(){
return mati;
}
public String tuString(){
String str=
"CHANNEL :"+channel+"\n"+
"VOLUME :"+volume+"\n"+
"MODERN :"+modern+"\n"+
"HIDUP :"+hidup+"\n"+
"MATI :"+mati+"\n";
return str;
}
static void test(){
//TURUNAN t=new TURUNAN (/*"SCTV","25","internet","hidup","mati"*/);
/*Scanner c=new Scanner(System.in);
System.out.println("masukkan channel yang anda inginkan"+t.getChannel());
channel=c.nextLine();
Scanner d=new Scanner(System.in);
System.out.println("masukkan volume yang anda inginkan"+t.getVolume());
volume=d.nextLine();
Scanner e=new Scanner(System.in);
System.out.println("masukkan channel yang anda inginkan"+t.getModern());
modern=e.nextLine();
Scanner f=new Scanner(System.in);
System.out.println("masukkan channel yang anda inginkan"+t.getHidup());
hidup=f.nextLine();
Scanner g=new Scanner(System.in);
System.out.println("masukkan channel yang anda inginkan"+t.getMati());
mati=g.nextLine();*/
/*System.out.println(t.getChannel());
System.out.println(t.getVolume());
System.out.println(t.getModern());
System.out.println(t.getHidup());
System.out.println(t.getMati());*/
}
public static void main(String[] args)throws IOException {
BufferedReader br= new BufferedReader (new InputStreamReader (System.in));
test();
}
}
Tidak ada komentar:
Posting Komentar