public class People {
private String eyecolor;
private String gender;
People() {
this.setEyecolor("Blue");
}
People(String x) {
this.setEyecolor(x);
}
People() {
this.setGender("male");
}
People(String d) {
this.setGender(d);
}
public void setEyecolor(String x) {
this.eyecolor = x;
}
public String getEyecolor() {
return eyecolor;
}
public String getGender() {
return gender;
}
public void setGender(String d) {
this.gender = d;
}
}
class Myclass {
public static void main(String [] args) {
People Mary = new People();
People Joe = new People("Brown");
Mary.setGender("female");
Joe.setGender("male");
OMG(Joe);
}
public static void OMG(People h) {
if(h.getGender("male")) {
System.out.println("OMG, look at his beautiful " + getEyecolor() + " eyes!");
}
else if(h.getGender("female")) {
System.out.println("OMG, look at her beautiful " + getEyecolor() + " eyes!");
}
else {
System.out.println("OMG, look at these beautiful " + getEyecolor() + " eyes!");
}
}
}
public class People {
private String eyecolor;
private String gender;
People(){
this.setEyecolor("Blue");
}
People(String x) {
this.setEyecolor(x);
}
public void setEyecolor(String x) {
this.eyecolor = x;
}
public String getEyecolor() {
return eyecolor;
}
public String getGender() {
return gender;
}
public void setGender(String d) {
this.gender = d;
}
}
class Myclass {
public static void main(String [] args) {
People Mary = new People();
People Joe = new People("Brown");
Mary.setGender("female");
Joe.setGender("male");
OMG(Joe);
}
public static void OMG(People h) {
if(h.getGender()=="male") {
System.out.println("OMG, look at his beautiful " + h.getEyecolor() + " eyes!");
}
else if(h.getGender()=="female") {
System.out.println("OMG, look at her beautiful " + h.getEyecolor() + " eyes!");
}
else {
System.out.println("OMG, look at these beautiful " + h.getEyecolor() + " eyes!");
}
}
}