2012420081
tugas 4 nie lanjutan dari tugas 2 N tugas 3
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package penampilan;
/**
*
* @author analita
*/
public class tugas4 {
public String nama;
public String rambut;
public String baju;
public String celana;
public String sepatu;
//penampilan overloading
public tugas4(String nama,String rambut,String baju,String celana,String sepatu){
this .nama=nama;
this.rambut=rambut;
this.baju=baju;
this.celana=celana;
this.sepatu=sepatu;
}
private tugas4() {
}
//Method overloading
public void print_a(String Temp){
System.out.println("nama="+"juned");
}public void print_b(String Temp){
System.out.println("rambut="+"tidak boleh panjang mas brow");
}public void print_c(String Temp){
System.out.println("baju="+"rapi n tidak kusam ya mas brow");
}public void print_d(String Temp){
System.out.println("celana="+"celana kain warna gelap");
}public void print_e(String Temp){
System.out.println("sepatu="+"sepatunya warna hitam mas brow");
}
public String getnama(){
return nama;
}
public String setnama(){
return nama;
}
public String getrambut(){
return rambut;
}
public String setrambut(){
return rambut;
}
public String getbaju(){
return baju;
}
public String setbaju(){
return baju;
}
public String getcelana(){
return celana;
}
public String setcelana(){
return celana;
}
public String getsepatu(){
return sepatu;
}
public String setsepatu(){
return sepatu;
}
public static void main(String[] args) {
tugas4 a=new tugas4();
a.setnama();
a.setrambut();
a.setbaju();
a.setcelana();
a.setsepatu();
a.print_a(a.getnama());
a.print_b(a.getrambut());
a.print_c(a.getbaju());
a.print_d(a.getcelana());
a.print_e(a.getsepatu());
}}
Posted by 13.45 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar