nama : fitri teguh wibowo
nim : 2012420130
public class kipas {
public String berputar;
public String tolatole;
public String mati;
public String dicolok;
public String dicabut;
public String getBerputar() {
return berputar;
}
public void setBerputar(String b) {
berputar = b;
}
public String getTolatole() {
return tolatole;
}
public void setTolatole(String b) {
tolatole = b;
}
public String getMati() {
return mati;
}
public void setMati(String b) {
mati = b;
}
public String getDicolok() {
return dicolok;
}
public void setDicolok(String b) {
dicolok = b;
}
public String getDicabut() {
return dicabut;
}
public void setDicabut(String b) {
dicabut = b;
}
public void print(String berputar, String tolatole, String mati){
System.out.println("kipas yang dicolok akan "+berputar+" dan "+tolatole);
System.out.println("kipas yang dicabut akan "+mati);
}
public void print(String temp){
System.out.println("kipas nyala karna "+dicolok);
System.out.println("kipas mati karna "+dicabut);
}
}
public static void main(String[] args) {
// TODO code application logic here
kipas a=new kipas();
a.setBerputar("berputar");
a.setMati("mati");
a.setTolatole("tola-tole");
a.setDicabut("dicabut kabelnya");
a.setDicolok("dicolok kabelnya");
a.print(a.getBerputar(), a.getTolatole(), a.getMati());
a.print(a.getDicabut());
}
}
Posted by 23.32 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar