program object orientasi(PBO)
# program class Handphone :
public class Handphone{
String hidupkan,lakukanPanggilan,kirimSms,matikan;
void printHandphone(){
System.out.println("hidupkan : " + hidupkan);
System.out.println("lakukanPanggilan : " + lakukanPanggilan);
System.out.println("kirimSms : " + kirimSms);
System.out.println("matikan : " + matikan);
}
}
# program class HandphoneBeraksi :
public class HandphoneBeraksi{
public static void main(String[ ] args){
Handphone handphoneku = new Handphone();
handphoneku.hidupkan ="Handphone hidup...";
handphoneku.lakukanPanggilan ="Kring, Kring, Kring ... panggilan dilakukan";
handphoneku.kirimSms ="Dung, Dung ... sms berhasil terkirim";
handphoneku.matikan ="Handphone mati ...";
handphoneku.printHandphone();
}
}
public class Handphone{
String hidupkan,lakukanPanggilan,kirimSms,matikan;
void printHandphone(){
System.out.println("hidupkan : " + hidupkan);
System.out.println("lakukanPanggilan : " + lakukanPanggilan);
System.out.println("kirimSms : " + kirimSms);
System.out.println("matikan : " + matikan);
}
}
# program class HandphoneBeraksi :
public class HandphoneBeraksi{
public static void main(String[ ] args){
Handphone handphoneku = new Handphone();
handphoneku.hidupkan ="Handphone hidup...";
handphoneku.lakukanPanggilan ="Kring, Kring, Kring ... panggilan dilakukan";
handphoneku.kirimSms ="Dung, Dung ... sms berhasil terkirim";
handphoneku.matikan ="Handphone mati ...";
handphoneku.printHandphone();
}
}
Comments
Post a Comment