Nama : Muhamad Risqi
N.I.M : 2012420100
public class voli_cons {
public
String serven;
public
String blok;
public
String umpan;
public
String pukul;
public
String toser, pasing, smaser;
public
String getServen() {
return
serven;
}
public
void setServen(String a) {
serven =
a;
}
public
String getBlok() {
return
blok;
}
public
void setBlok(String a) {
blok = a;
}
public
String getUmpan() {
return
umpan;
}
public
void setUmpan(String a) {
umpan =
a;
}
public
String getPukul() {
return
pukul;
}
public
void setPukul(String a) {
pukul =
a;
}
public
String gettoser(){
return
toser;
}
public
void settoser(String a){
toser=a;
}
public
String getpasing(){
return
pasing;
}
public
void setpasing(String a){
pasing=a;
}
public
String getsmaser(){
return
smaser;
}
public
void setsmaser(String a){
smaser=a;
}
//overloading
public
void tampil(String serven, String blok, String umpan, String pukul){
System.out.println("melakukan "+serven);
System.out.println("melakukan "+blok+" dan "+umpan);
System.out.println("melakukan "+pukul);
}
public
void tampil(String a){
System.out.println(toser+"sedang "+umpan+" kepada "+
smaser);
System.out.println(pasing+" sedang "+pukul+" bola");
}
}
public static void main(String[] args) {
voli_cons a=new voli_cons();
a.settoser("toser");
a.setsmaser("smaser");
a.setpasing("pasing");
a.setBlok("ngeblok bola");
a.setPukul("mensmash bola");
a.setServen("menserv bola");
a.setUmpan("mengumpan bola");
a.tampil(a.getServen(), a.getPukul(), a.getBlok(), a.getUmpan());
a.tampil(a.gettoser());
}
Posted by 22.29 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar