package tgspraktikum;
class rumah{
private String a = "Rumah mewah";
public void info(){
//System.out.println("Dipanggil pada: "+this);
System.out.println(" ");
System.out.println("Rumah: "+a);
}
}
class rumahindah extends rumah{
private String b = "tombol alarm";
public void info(){
System.out.println(" ");
super.info();
System.out.println("Rumahindah: "+b);
}
}
public class Tgspraktikum {
public static void main(String[] args) {
rumah rumahan = new rumah();
rumahindah yarumah = new rumahindah();
rumahan.info();
yarumah.info();
}
}
0 komentar:
Post a Comment