Ayo Bangkit sobat..!!!!!

Tugas Java 2 ” SuperClass dan SubClass “

SUPERCLASS :

class SuperClass {

public void Vitamin() {

System.out.println(”Judul-Judul Film : “);

System.out.println(”–DRAG ME TO HELL–”);

System.out.println(”—-JANJI JONI—-”);

System.out.println(”——VIRGIN——-”);

System.out.println(”——-KCB2——–”);

System.out.println(”-MENGEJAR MATAHARI-”);

}

public static void main(String[] args) {

SuperClass sc = new SuperClass();

sc.Film();

}

}

Output

Judul-Judul Film :

–DRAG ME TO HELL–

—-JANJI JONI—-

——VIRGIN——-

——-KCB2——–

-MENGEJAR MATAHARI-

SUBCLASS :

class SubClass extends SuperClass {

public void Panggil() {

super.Film();

System.out.println(”Jam Tayang :”);

}

public void VitaminA() {

System.out.println(”–DRAG ME TO HELL–: 12.15-14.15, 14.30-16.30, 16.45-18.45, 19.00-21.00″);

}

public void VitaminB1() {

System.out.println(”—-JANJI JONI—- : 12.10-14.10, 14.25-16.25, 16.40-18.40, 18.55-20.55″);

}

public void VitaminC() {

System.out.println(”——VIRGIN——- : 12.20-14.20, 14.35-16.35, 16.50-18.50, 19.05-21.05″);

}

public void VitaminD() {

System.out.println(”——-KCB2——– : 12.10-14.10, 14.25-16.25, 16.40-18.40, 18.55-20.55″);

}

public void VitaminE() {

System.out.println(”-MENGEJAR MATAHARI- : 12.20-14.20, 14.35-16.35, 16.50-18.50, 19.05-21.05″);

}

public static void main(String[]args) {

SubClass scs = new SubClass();

scs.Panggil();

scs.DRAG ME TO HELL();

scs.JANJI JONI();

scs.VIRGIN();

scs.KCB2();

scs.MENGEJAR MATAHARI();

}

}

OUTPUT

Judul-Judul Film :

–DRAG ME TO HELL–

—-JANJI JONI—-

——VIRGIN——-

——-KCB2——–

-MENGEJAR MATAHARI-

Jam Tayang :

–DRAG ME TO HELL–: 12.15-14.15, 14.30-16.30, 16.45-18.45, 19.00-21.00

—-JANJI JONI—- : 12.10-14.10, 14.25-16.25, 16.40-18.40, 18.55-20.55

——VIRGIN——- : 12.20-14.20, 14.35-16.35, 16.50-18.50, 19.05-21.05

——-KCB2——– : 12.10-14.10, 14.25-16.25, 16.40-18.40, 18.55-20.55

-MENGEJAR MATAHARI- : 12.20-14.20, 14.35-16.35, 16.50-18.50, 19.05-21.05

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s