NIM : 2012420080
private String nama;
private String kekuatan ;
private String kelemahan ;
private String musuh_utama ;
private double rating_dari_survey ;
public superhero(String nama){
this.nama=nama;
}
public superhero(String kekuatan, String musuh_utama){
this.kekuatan=kekuatan;
this.musuh_utama=musuh_utama;
}
public superhero(String kelemahan,double rating){
this.kelemahan=kelemahan;
this.rating_dari_survey=rating;
}
void superhero1(String nama){
System.out.println ("Nama Superhero = "+getNama());
}
void superhero1(String kekuatan, String musuh_utama){
System.out.println(" Kekuatan = "+getKekuatan());
System.out.println(" Musuh_Utama = "+getMusuh_utama());
}
void superhero1(String kelemahan,double rating){
System.out.println(" Kelemahan = "+getKelemahan());
System.out.println(" rating = "+getRating_dari_survey());
}
public String getNama() {
return nama;
}
public void setNama(String nama) {
this.nama = nama;
}
public String getKekuatan() {
return kekuatan;
}
public void setKekuatan(String kekuatan) {
this.kekuatan = kekuatan;
}
public String getKelemahan() {
return kelemahan;
}
public void setKelemahan(String kelemahan) {
this.kelemahan = kelemahan;
}
public String getMusuh_utama() {
return musuh_utama;
}
public void setMusuh_utama(String musuh_utama) {
this.musuh_utama = musuh_utama;
}
public double getRating_dari_survey() {
return rating_dari_survey;
}
public void setRating_dari_survey(double rating_dari_survey) {
this.rating_dari_survey = rating_dari_survey;
}
public static void main(String[] args) {
superhero x=new superhero("catwomen");
superhero z=new superhero("cakaran maut","buldog");
superhero y=new superhero("air",7.8);
x.superhero1(x.getNama());
z.superhero1(z.getKekuatan(),z.getMusuh_utama());
y.superhero1(y.getKelemahan(),y.getRating_dari_survey());
}
}
Posted by 12.41 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar