nim; 2012420010
kelas; A
ini tugas saya bu vega......
package tugas;
/**
*
* @author USER
*/
public class televisi4 {
private String nama;
private String type;
private String warna;
private int ukuran;
private int volume;
public televisi4(){
}
public televisi4(String nama,String type,String warna){
this.nama=nama;
this.type=type;
this.warna=warna;
}
public televisi4(int ukuran, int volume ){
this.ukuran=ukuran;
this.volume=volume;
}
void printtelevisi (){
}
void printtelevisi (String nama,String type,String warna){
System.out.println("objek televisi berhasil di buat dengan nama "+getNama());
System.out.println("dengan type "+getType());
System.out.println("dengan warna "+getWarna());
}
public void printtelevisi(int ukuran, int volume) {
this.volume = volume;
System.out.println("berdasrkan ukuran "+getUkuran());
System.out.println("volume maksimal "+getVolume()+" ");
}
/**
* @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 ){
televisi4 x=new televisi4();
televisi4 y=new televisi4("thosiba", "lcd", "hitam");
televisi4 z=new televisi4(32,100);
x.printtelevisi();
y.printtelevisi(x.getNama(), x.getType(), x.getWarna());
z.printtelevisi(z.getUkuran(), z.getVolume());
}}
Posted by 10.57 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar