public interface interface_alatmusik {
void nama();
void jenis();
void nada();
}
class interfacegitar implements interface_alatmusik{
@Override
public void nama() {
System.out.println("Nama Alat musik = Gitar");
}
@Override
public void jenis() {
System.out.println("Jenis alat musik = petik");
}
@Override
public void nada() {
System.out.println("dimainkan dengan di petik");
}
}
class interfacesuling implements interface_alatmusik{
@Override
public void nama() {
System.out.println("Nama Alat musik = suling");
}
@Override
public void jenis() {
System.out.println("Jenis alat musik = tiup");
}
@Override
public void nada() {
System.out.println("dimainkan dengan di tiup");
}
}
class interfacedrum implements interface_alatmusik{
@Override
public void nama() {
System.out.println("Nama Alat musik = Drum");
}
@Override
public void jenis() {
System.out.println("Jenis alat musik = pukul");
}
@Override
public void nada() {
System.out.println("dimainkan dengan di pukul");
}
public static void main(String[] args) {
interfacegitar a=new interfacegitar();
a.nama();
a.jenis();
a.nada();
System.out.println("=======");
interfacesuling y=new interfacesuling();
y.nama();
y.jenis();
y.nada();
System.out.println("=======");
interfacedrum z=new interfacedrum();
z.nama();
z.jenis();
z.nada();
}
}
Posted by 07.39 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar