In Listing 5.12, we set the data for the object speciesOfTheMonth as
follows:
speciesOfTheMonth.setSpecies("Klingon ox", 10, 15);
Could we have used the following code instead?
speciesOfTheMonth.name = "Klingon ox";
speciesOfTheMonth.population = 10;
speciesOfTheMonth.growthRate = 15;
If we could have used this alternative code, why didn’t we? If we could not
have used this alternative code, explain why we could not use it.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here