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...



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.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here