* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package interfes;
/**
*
* @author User
*/
public interface transportasi {
void nama();
void transit();
void bahanbakar();
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package interfes;
/**
*
* @author User
*/
public class transportasidarat implements 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("Bahan bakar solar atau premium");
}
public static void main(String[] args) {
transportasidarat bus = new transportasidarat();
bus.nama();
bus.transit();
bus.bahanbakar();
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package interfes;
/**
*
* @author User
*/
public class transportasilaut implements 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("Berbahan bakar nitrogen atau solar");
}
public static void main(String[] args) {
transportasilaut kapal = new transportasilaut();
kapal.nama();
kapal.transit();
kapal.bahanbakar();
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package interfes;
/**
*
* @author User
*/
public class transportasiudara implements 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 pesawat = new transportasiudara();
pesawat.nama();
pesawat.transit();
pesawat.bahanbakar();
}
}
Posted by 03.05 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar