nim; 2012420010
kelas A
public class televisi {
private String nama;
private String type;
private String warna;
private int ukuran;
private int volume;
void printtelevisi (){
System.out.println("objek televisi berhasil di buat dengan nama "+getNama());
System.out.println("dengan type "+getType());
System.out.println("dengan warna "+getWarna());
System.out.println("berdasrkan ukuran "+getUkuran());
}
void printtelevisi (String nama,String type,String warna){
System.out.println("volume maksimal "+getVolume()+" ");
}
public void printtelevisi(int ukuran, int volume) {
this.volume = volume;
}
/**
* @return the nama
*/
public String getNama() {
return nama;
}
/**
* @param nama the nama to set
*/
public void setNama(String nama) {
this.nama = nama;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the warna
*/
public String getWarna() {
return warna;
}
/**
* @param warna the warna to set
*/
public void setWarna(String warna) {
this.warna = warna;
}
/**
* @return the ukuran
*/
public int getUkuran() {
return ukuran;
}
/**
* @param ukuran the ukuran to set
*/
public void setUkuran(int ukuran) {
this.ukuran = ukuran;
}
/**
* @return the volume
*/
public int getVolume() {
return volume;
}
/**
* @param volume the volume to set
*/
public void setvolumemax(int volume) {
this.volume = volume;
}
public static void main (String[] args ){
televisi thosiba=new televisi();
thosiba.setNama("thosiba");
thosiba.setType("LCD");
thosiba.setWarna("hitam");
thosiba.setUkuran(32);
thosiba.setvolumemax(100);
thosiba.printtelevisi();
thosiba.printtelevisi(thosiba.getNama(), thosiba.getType(), thosiba.getWarna());
thosiba.printtelevisi(thosiba.getUkuran(), thosiba.getVolume());
}
Posted by 11.03 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar