Nama : Mochammad Buyung Eliyasah
NIM : 2012420044
Kelas : A
//class Dancer//
package dancer;
public class Dancer {
String nama,aliran,grup;
void nama (){
System.out.println("");
}
void aliran (){
System.out.println("");
}
void grup (){
System.out.println("");
}
}
//class moderndancer//
package dancer;
public class moderndancer extends Dancer {
@Override
void nama(){
nama="Kim Jonghyun";
System.out.println("Nama :"+nama);
}
@Override
void aliran(){
aliran="Hip Hop";
System.out.println("Aliran :"+aliran);
}
@Override
void grup(){
grup="HBS (Havy Buck Style)";
System.out.println("Grup :"+grup);
}
}
//class tradisionaldancer//
package dancer;
public class tradisionaldancer extends Dancer {
@Override
void nama(){
nama="Chintiyas";
System.out.println("Nama :"+nama);
}
@Override
void aliran(){
aliran="Jaipong";
System.out.println("Aliran :"+aliran);
}
@Override
void grup(){
grup="Rumingkang";
System.out.println("Grup :"+grup);
}
}
//class balletdancer//
package dancer;
public class balletdancer extends Dancer {
@Override
void nama(){
nama="Safira";
System.out.println("Nama :"+nama);
}
@Override
void aliran(){
aliran="Ballet";
System.out.println("Aliran :"+aliran);
}
@Override
void grup(){
grup="solo";
System.out.println("Grup :"+grup);
}
}
//class main//
package dancer;
public class main {
public static void main(String[] args) {
Dancer a=new Dancer();
moderndancer b =new moderndancer();
tradisionaldancer c =new tradisionaldancer();
balletdancer d =new balletdancer();
a.nama();
a.aliran();
a.grup();
b.nama();
b.aliran();
b.grup();
c.nama();
c.aliran();
c.grup();
d.nama();
d.aliran();
d.grup();
}
}
hasil:
Posted by 00.19 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar