package abstractk;
/*
* To change this
template, choose Tools | Templates
* and open the
template in the editor.
*/
abstract class
bolaabstrak {
public abstract
void nama();
public abstract
void posisi();
public abstract
void club();
public abstract
void prestasi();
}
class spanyol extends bolaabstrak{
@Override
public void nama()
{
System.out.println("Nama : Andreas Iniesta");
}
@Override
public void
posisi() {
System.out.println("Posisi :
Gelandang" );
}
@Override
public void club()
{
System.out.println("Club : Barselona");
}
@Override
public void
prestasi() {
System.out.println("Prestasi : 1x b'dor"+"\n");
}}
class inggris extends bolaabstrak{
@Override
public void nama()
{
System.out.println("Nama : Dany Wellback");
}
@Override
public void
posisi() {
System.out.println("Posisi : Striker");
}
@Override
public void club()
{
System.out.println("Club : Manchester United");
}
@Override
public void
prestasi() {
System.out.println("Prestasi : 1x b'dor"+"\n");
}
}
class
persebaya2 extends bolaabstrak{
@Override
public void
nama() {
System.out.println("Nama : Fernando Soler");
}
@Override
public void
posisi() {
System.out.println("Posisi : Striker");
}
@Override
public void
club() {
System.out.println("club : Persebaya 1927");
}
@Override
public void
prestasi() {
System.out.println("Prestasi : 1x b'dor"+"\n");
}
}
class main {
public static
void main(String[] args) {
spanyol a=new
spanyol();
inggris b=new
inggris();
persebaya2
c=new persebaya2();
a.nama();
a.posisi();
a.club();
a.prestasi();
b.nama();
b.posisi();
b.club();
b.prestasi();
c.nama();
c.posisi();
c.club();
c.prestasi();
}
}
====outpu====
Posted by 23.45 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar