Question: 16. You have the following Java code that's part of a class you have written, but you are unable to compile it. What is the

16. You have the following Java code that's part of a class you have written, but you are unable to compile it. What is the likely cause of the problem? You may assume that bunnies is an instance variable. public static int get Future Population (int growth Factor) return (int) Math.pow (bunnies, growth Factor); 17. Write a factory method for the Cycle class that will return a Cycle object with the name "tricycle" and 3 wheels. You can assume that the constructor method for the Cycle class takes a String and an int as arguments and these correspond to the name and number of wheels for a Cycle. 18. What is wrong with the following code example: public class Person private String name; public void setName (String name) name = name; 19. Suppose you are creating your own Java class to model a City and want to store information about how much rainfall a city receives in an average year. A) Propose a data type and identifier for that field. B) Indicate why you believe your choice of data type is reasonable or better than alternatives
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
