Nama : Mochammad Buyung Eliyasah
NIM : 2012420044
Kelas : A
//abstract class Xtreamtoys//
package xtreamtoys;
public abstract class Xtreamtoys {
public void rincian () {
System.out.println("");
}
public abstract void nama();
public abstract void tipe();
public abstract void ukuran();
}
//class abstract skate//
package xtreamtoys;
public abstract class skate extends Xtreamtoys {
@Override
public void nama() {
System.out.println("Urban");
}
@Override
public void tipe() {
System.out.println("Skate Board");
}
@Override
public void ukuran() {
System.out.println("7,5");
}
}
//class abstract BMX//
package xtreamtoys;
public abstract class BMX extends Xtreamtoys {
@Override
public void nama() {
System.out.println("WimCycle");
}
@Override
public void tipe() {
System.out.println("BMX Standart");
}
@Override
public void ukuran() {
System.out.println("medium");
}
}
//class abstract otopad//
package xtreamtoys;
public abstract class otopad extends Xtreamtoys {
@Override
public void nama() {
System.out.println("School");
}
@Override
public void tipe() {
System.out.println("Scooter");
}
@Override
public void ukuran() {
System.out.println("8");
}
}
//class abstract main//
package xtreamtoys;
public abstract class main {
public static void main(String[] args) {
skate x = new skate() {};
x.nama ();
x.tipe();
x.ukuran();
System.out.println("");
BMX y = new BMX() {};
y.nama ();
y.tipe();
y.ukuran();
System.out.println("");
otopad z = new otopad() {};
z.nama ();
z.tipe();
z.ukuran();
System.out.println("");
}
}
hasil :
Posted by 01.00 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar