Test Corrections

Question ✔️ Explanation
10 II only I only Only I will return a correct value. Choice II would be the correct answer since the recursive call will eventually give an out of bounds error since data[-1] will be called.
11

If (last < 0)

return -1;

If (last <= 0)

return -1;

The = would cause the answer to be incorrect since it means that when the target is at the element 0 then -1 will be returned instead of 0.
14 v.getMileage () myVehicles [v] .getMileage () This is the incorrect answer because myVehicles is an arraylist, not an array. The correct answer would be E as the algorithm uses an enhanced loop for accessing the elements.
16 k + a1.length k + a1.length + 1 This is the incorrect answer since it will cause the result to remain 0.
25 I and II only II only I is also a correct answer since it gives the user information about the height, width and depth of the box which can help to find if one box fits in the other.
34 II only II and III only III would be an incorrect answer since it uses the default point constructor for assigning a center x,y. III will also cause a compile time error.