public class Cow {
private String cowType;
private String sound;
private int numMilkings;
public Cow(){
this.numMilkings = 0;
this.cowType = null;
this.sound = null;
}
public Cow (String cowType, String sound) {
this.numMilkings = 0;
this.cowType = cowType;
this.sound = sound;
}
public Cow(String cowType, String sound, int numMilikings) {
this.numMilkings = numMilikings;
this.cowType = cowType;
this.sound = sound;
}
public void setcowType(String cowType) {
this.cowType = cowType;
}
public String getcowType() {
return cowType;
}
public void toString() {
}
public static void main(String[] args) {
Cow firstCow = new Cow("holstein", "moo");
Cow secondCow = new Cow();
Cow thirdCow = new Cow("holstein", "moo", 100);
firstCow.setcowType("a");
firstCow.getcowType();
System.out.println(firstCow.getcowType());
}
}
Cow.main(null)