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