Before the practice
Things to Keep in Mind
Reviewing my practice:
The most questions missed were in topic 2C.
This topic is under section 2, which is the Code Logic section. The requirement is as follows:
This tells me that I need to review coding logic, especially following written code.
I have a decent understanding of arrays and booleans.
The topic that I need the most practice with is recursion, but I will be getting to all the topics.
# Corrections:
### 1
this is incorrect, as it would have been returned if it was iterated one time fewer. Therefore, the correct answer is 7.
### 8
My answer was "II only" but I should have picked "I and II only" because option 1 would still create a new object, just without parameters.
### 10,11
10. I selected I only, but this is incorrect as it will not return an error if the element was target. Option II is correct because it will always be out of bounds.
11. the correct answer for the missing code is
if (last< data.length) return -1;
because this will prevent the ArrayIndexOutOfBoundsException.
### 12
ompute is incorrect because it would be returned if k was incremented by 1. Since k is incremented by 2 and starts at 1, optr will be returned.
### 15
The correct answer was I only because the second segment returns an error.
### 22
I answered that Line 6 will not compile because the statement is ambiguous. The compiler cannot determine which length method should be called. The correct answer is Line 4 will not compile because variables of type Book may only call methods in the Book class.
### 23
D is incorrect, it would be correct if k>1. B is correct because baboon is indexed first and is moved to 1. cat stays. Bass is moved to index 3. Zebra doesn't change. baboon is moved to index 5.
### 24
I said that 3 is printed. The actual value that would be printed is 7.
### 25
I answered that all three options were correct. This was false because a box with a smaller volume still could have a larger surface area than the other box. This was an issue where I didn't fully understand or comprehend the question. The answer should have been I and II which both return the depth of the box.
### 26
The option B which I selected increments and checks for odd, but will not print odd values. A will return the correct values, as it will print the odd values.
### 27
I said that 1 would be the result. the correct answer was 8 because it repeats this process, decreasing n by 1 each time, until n is 2. After four loops, x becomes 8, and the method returns 8.
### 28
I said that x willl sometimes be 1 at //Point B. the correct answer will be n will always be greater than 2 at // Point B.
### 29
The correct answer is E because it will return multiples of 4, instead of the numbers 1-25
### 30
The correct answer is C because the second part only goes to an index of 7.
### 31
I said that nothing would be printed. The correct answer is 5 7 8 11 19.
### 36
My answer was incorrect because 12 would result in the same output as 8. The correct answer is 8, 9, and 11 because 8 is even and y = 3, 9 is odd and not greater than 9 so y = 1, 11 is odd and greater than 9 so y = 5
### 37
My answer is incorrect because choice 3 also works, since once the integer is equal to 7, the loop will end as the conditions are no longer true.
### 39
16 is correct, I will be able to explain this once I learn about recursion
### 40
It indexes the substring from 0-4 in that order and repeats this process.
Things to Focus, Next Steps
I have improved since the last MCQ practice. However, this MC took me very long to complete. I must work on the timing and practice more often. ### 3 ###