Test Corrections

Question 3

  • The answer I provided also allowed other classes to modify the value "myC" and not just accessing it. Answer B is the only other answer that provides getC to be accessible by other classes (Public) and by returning the value, it allows the use to just access it without modifying it in other classes. ### Question 16

  • In this question, I made the mistake of looking at the previous for loop and trying to copy the same format as it look above. So I answered K to have the same format. However the correct answer should be "k + a1.length" because it allows all the values of a1 to be copied over in the "results."

Question 22

  • In the question, I thought that using .length would confuse the program and create a compiling error because it is being defined as a class and .length is always used in java to find the length of something. Since pagesPerMinute() is defined in the AudioBook class, Line 4 would cause the error because the book[0] is an AudioBook and not a Book. The program has to somehow know that tis is referring to an AudioBook and not a Book object.

Question 26

  • For this question I did not see that the line is printing the value of K instead of the arr[k]. The only other correct answer is the A where it goes through each value of the array and checks if it is odd.

Question 40

  • In my mind, the print statement and the whatsItDo(temp) where flipped so answered it that way. Since it is flipped, the answer I gave should be flipped too thus letter C is the correct answer.