langsung aja,......
>>abstract
public abstract class bos {
public void gaji(){
System.out.println("gaji sudah di terima");
}
public abstract void uang();
}
>>sub1
public class dirut extends bos {
public void uang(){
System.out.println("dirut sudah menerima gaji");
}
}
>>sub2
public class manager extends bos {
public void uang(){
System.out.println("manager sudah menerima gaji");
}
}
>>sub3
public class supervisor extends bos {
public void uang(){
System.out.println("supervisor sudah menerima gaji");
}
}
>>class panggil
public static void main(String[] args) {
// TODO code application logic here
bos a=new bos() {
@Override
public void uang() {
throw new UnsupportedOperationException("Not supported yet.");
}
};
a.gaji();
dirut b=new dirut();
b.uang();
manager c=new manager();
c.uang();
supervisor d=new supervisor();
d.uang();
}
}
by : syifaus surur@112
Posted by 00.32 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar