gan, klo salah boleh comment
>>class interface
public interface Interface_bos {
public void gaji();
}
>>subclass1
public class direktur implements Interface_bos {
@Override
public void gaji(){
System.out.println("diruktur = sudah mendapatkan gaji");
}
}
>>subclass2
public class manager implements Interface_bos {
@Override
public void gaji(){
System.out.println("manager = sudah mendapatkan gaji");
}
}
>>subclass3
public class supervisor implements Interface_bos {
@Override
public void gaji(){
System.out.println("supervisor = sudah mendapatkan gaji");
}
}
>>subclass4
public class karyawan implements Interface_bos {
@Override
public void gaji(){
System.out.println("karyawan = sudah mendapatkan gaji");
}
}
>>class panggil
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
direktur dir=new direktur();
manager mag=new manager();
supervisor sup=new supervisor();
karyawan kar=new karyawan();
dir.gaji();
mag.gaji();
sup.gaji();
kar.gaji();
}
}
by : syifaus surur@112
Posted by 00.27 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar