interface interface_superhero {
}
interface interfacespiderman{
void namaspiderman ();
void kekuatanspiderman ();
void kelemahanspiderman ();
}
interface interfacecatwoman{
void namacatwoman ();
void kekuatancatwoman ();
void kelemahancatwoman ();
}
interface interfacesuperman{
void namasuperman ();
void kekuatansuperman ();
void kelemahansuperman ();
}
class print implements interfacespiderman,interfacecatwoman,interfacesuperman{
@Override
public void namaspiderman() {
System.out.println("Superhero = Spiderman");
}
@Override
public void kekuatanspiderman() {
System.out.println("Kekuatan = Mempunyai Gen Laba-Laba");
}
@Override
public void kelemahanspiderman() {
System.out.println("Kelemahan = Obat Serangga");
}
@Override
public void namacatwoman() {
System.out.println("Superhero = Catwoman");
}
@Override
public void kekuatancatwoman() {
System.out.println("Kekuatan = Kecepatan Lebih");
}
@Override
public void kelemahancatwoman() {
System.out.println("Kelemahan = Anjing Buldog");
}
@Override
public void namasuperman() {
System.out.println("Superhero = Superman");
}
@Override
public void kekuatansuperman() {
System.out.println("Kekuatan = Bisa Terbang");
}
@Override
public void kelemahansuperman() {
System.out.println("Kelemahan = Cripton Net");
}
}
class main{
public static void main(String[] args) {
print v=new print();
v.namaspiderman();
v.kekuatanspiderman();
v.kelemahanspiderman();
System.out.println("-------------------------------------------------------");
print x=new print ();
x.namacatwoman();
x.kekuatancatwoman();
x.kelemahancatwoman();
System.out.println("------------------------------------------------------");
print y=new print ();
y.namasuperman();
y.kekuatansuperman();
y.kelemahansuperman();
}
}
Posted by 13.00 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar