Why does:
if(Type='d'){
System.out.println("Please enter the Furlength");
String FurLength = Keyboard.readString();
System.out.println("Please enter the Size of the dog");
String Size = Keyboard.readString();
pets [petCount] = new Dog(Name, Sex, Age, FurLength, Size);
}
else if(Type='c'){
System.out.println("Please enter the FurColor of the Cat");
String FurColor = Keyboard.readString();
System.out.println("Please enter the EyeColor of the Cat");
String EyeColor = Keyboard.readString();
pets [petCount] = new Cat(Name, Sex, Age, FurColor, EyeColor);
}
else if(Type='b'){
System.out.println("Please enter the FeatherColor");
String FeatherColor = Keyboard.readString();
System.out.println("Please enter the BeekColor of the Bird");
String BeekColor = Keyboard.readString();
pets [petCount] = new Bird(Name, Sex, Age, FeatherColor, BeekColor);
}
else{
System.out.println("You have entered the wrong option!");
}
not work. The error I get says:
found:java.lang.String
required:boolean
if(Type='d')
but I tried if(Type=='d')
and it still wont work. Can anyone help me find out whats wrong.
Thanks