* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package abstrac;
/**
*
* @author User
*/
public abstract class transportasi {
public abstract void nama();
public abstract void transit();
public abstract void bahanbakar();
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package abstrac;
/**
*
* @author User
*/
public class transportasidarat extends transportasi{
@Override
public void nama() {
System.out.println("Bus");
}
@Override
public void transit() {
System.out.println("Berhenti di terminal");
}
@Override
public void bahanbakar() {
System.out.println("Berbahan bakar Solar atau Premium");
}
public static void main(String[] args) {
transportasidarat x = new transportasidarat();
x.nama();
x.transit();
x.bahanbakar();
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package abstrac;
/**
*
* @author User
*/
public class transportasilaut extends transportasi{
@Override
public void nama() {
System.out.println("Kapal Selam");
}
@Override
public void transit() {
System.out.println("Berhenti di pelabuhan");
}
@Override
public void bahanbakar() {
System.out.println("Barbahan bakar nitrogen atau solar");
}
public static void main(String[] args) {
transportasilaut y = new transportasilaut();
y.nama();
y.transit();
y.bahanbakar();
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package abstrac;
/**
*
* @author User
*/
public class transportasiudara extends transportasi{
@Override
public void nama() {
System.out.println("Pesawat");
}
@Override
public void transit() {
System.out.println("Berhenti di bandara");
}
@Override
public void bahanbakar() {
System.out.println("Berbahan bakar aftur");
}
public static void main(String[] args) {
transportasiudara z = new transportasiudara();
z.nama();
z.transit();
z.bahanbakar();
}
}
Posted by 00.26 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar