image.png
14.1. (2 points) There is a bug on the that should replace this line to fix the bug. a bug on the line marked line 1 (questi We were unable to transcribe this image14.1. (2 points) There is a bug on the that should replace this line to fix the bug. a bug on the line marked “line 1 (question 14.1)”. Write the correct line of code 14.2 (1 point) How many constructors does sheet. W constructors does the Species class have? Write the number on your answer 14.3 (2 points) Assume that the bug on the line marked the main method, what will be printed? in the line marked “line 1 (question 14.1)” is fixed. When you run “answer sheet, list the names of all of the member variables (fields) of the Species 14.4 (1 points) On your answer sheet, list the class. 14.5 (1 point) Which of the following lines of code when placeda e following lines of code when placed as the last line in main will change the name of the Species object stored in s? A. s.name = “Elephant”; B. S.getName() = “Elephant”: C. Species.name = “Elephant”; D. None of the above. You cannot change the name of the Species object stored in s. 14.0 (2 points) Consider the implementation of the same population method shown above. This method is supposed to retum true if the calling object’s population array contains exactly the same values in the same order as the parameter object’s population array, and false if one or more entries differ. However, this implementation has a bug. For which of the following pairs of populations will same Population return an INCORRECT value? A. this.population: 12, 3, 4, 5, 6, 7, 8) other.population: 12, 3, 4, 5, 6, 7, 8) B. this.population: 2, 3, 4, 5, 6, 7, 8) other.population: 12, 1, 5, 4, 6, 8, 10) c. this.population: (2, 3, 4, 5, 6, 7, 8) other.population: 13, 2, 1, 0, 6, 7, 8] D. this.population: {2, 3, 4, 5, 6, 7, 8) other.population: 8, 7, 6, 5, 4, 3, 2) E. this.population: 12, 3, 4, 5, 6, 7, 8) other.population: (10, 11, 12, 13, 14, 15, 16)



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *