Interface Dengan Objek Game Langsung saja kalian bisa lihat Source dan outputnya di bawah ini :
Source :
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package baru;
/**
*
* @author Axio
*/
interface gamebaru{
void game();
}
interface GTAVin {
void namagameGTAV();
void produksiGTAV();
void tahunGTAV();
}
interface tombraiderin{
void namagametomb();
void produksitomb();
void tahuntomb();
}
interface GOWin{
void namagameGOW();
void produksiGOW();
void tahunGOW();
}
class gameinterface implements gamebaru,GTAVin,tombraiderin,GOWin{
@Override
public void game() {
System.out.println("Game Keluaran Terbaru : ");
System.out.println("=================================================");
}
@Override
public void namagameGTAV() {
System.out.println("Nama Game = Grand Theft Auto V");
}
@Override
public void produksiGTAV() {
System.out.println("Produksi = RockstarGames");
}
@Override
public void tahunGTAV() {
System.out.println("Tahun Terbit = 17 September 2013");
System.out.println("=================================================");
}
@Override
public void namagametomb() {
System.out.println("Nama Game = Tomb Raider");
}
@Override
public void produksitomb() {
System.out.println("Produksi = Square Enix dan Crystal Dynamics");
}
@Override
public void tahuntomb() {
System.out.println("Tahun Terbit = 5 Maret 2013");
System.out.println("=================================================");
}
@Override
public void namagameGOW() {
System.out.println("Nama Game = God of War: Ascension");
}
@Override
public void produksiGOW() {
System.out.println("Produksi = Sony");
}
@Override
public void tahunGOW() {
System.out.println("Tahun Terbit = 12 Maret 2013");
System.out.println("=================================================");
}
}
class gameinterfacemain{
public static void main(String[] args) {
gameinterface a=new gameinterface();
a.game();
a.namagameGTAV();
a.produksiGTAV();
a.tahunGTAV();
a.namagametomb();
a.produksitomb();
a.tahuntomb();
a.namagameGOW();
a.produksiGOW();
a.tahunGOW();
}
}
Output :
Nama : David Ibrahim
Nim : 2012420096
Fakultas : Teknik Informatika
Kelas : A
Unitomo
Posted by 10.19 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar