void nama();
void jenis();
void bahanbakar();
}
class bus3 implements interfaces{
protected String nama;
String jenis;
String bahanbakar;
@Override
public void nama() {
nama="bus3";
System.out.println("nama alat transportasi ="+nama); }
@Override
public void jenis() {
jenis="transportasidarat";
System.out.println("jenis alat transportasi ="+jenis);
}
@Override
public void bahanbakar() {
bahanbakar="solar";
System.out.println("bahanbakar alat transportasi ="+bahanbakar);
}
}
class motor3 implements interfaces{
protected String nama;
String jenis;
String bahanbakar;
@Override
public void nama() {
nama="motor3";
System.out.println("nama alat transportasi ="+nama); }
@Override
public void jenis() {
jenis="transportasidarat";
System.out.println("jenis alat transportasi ="+jenis);
}
@Override
public void bahanbakar() {
bahanbakar="bensin";
System.out.println("bahanbakar alat transportasi ="+bahanbakar);
}
}
class pesawat3 implements interfaces{
protected String nama;
String jenis;
String bahanbakar;
@Override
public void nama() {
nama="pesawat3";
System.out.println("nama alat transportasi ="+nama); }
@Override
public void jenis() {
jenis="transportasiudara";
System.out.println("jenis alat transportasi ="+jenis);
}
@Override
public void bahanbakar() {
bahanbakar="avgas";
System.out.println("bahanbakar alat transportasi ="+bahanbakar);
}
public static void main(String[] args) {
bus3 a=new bus3();
a.nama();
a.jenis();
a.bahanbakar();
System.out.println(".....");
motor3 c=new motor3();
c.nama();
c.jenis();
c.bahanbakar();
System.out.println(".....");
pesawat3 e=new pesawat3();
e.nama();
e.jenis();
e.bahanbakar();
System.out.println(".....");
}
}
Posted by 00.40 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar