NIM : 2012420080
private String nama;
private String kekuatan ;
private String kelemahan ;
private String musuh_utama ;
private double rating_dari_survey ;
void superhero(String nama){
System.out.println ("Nama Superhero = "+getNama());
}
void superhero(String kekuatan, String musuh_utama){
System.out.println(" Kekuatan = "+getKekuatan());
System.out.println(" Musuh_Utama = "+getMusuh_utama());
}
void superhero(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 spiderman=new superhero();
spiderman.setNama("Spiderman");
spiderman.setKekuatan("jaring laba-laba");
spiderman.setKelemahan("obat serangga");
spiderman.setMusuh_utama("Gren Goblin");
spiderman.setRating_dari_survey(47.5);
spiderman.superhero(spiderman.getNama());
spiderman.superhero(spiderman.getKekuatan(),spiderman.getMusuh_utama());
spiderman.superhero(spiderman.getKelemahan(),spiderman.getRating_dari_survey());
}
}
Posted by 12.18 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar