CS300 Incorrect Answers
Q. = Question | WA. = Your answer | AC. = Correct answer
1. Checked or Unchecked 03 (September 16, 2026)
Q. Which kinds of problems tend to correspond to which category of exception?
WA. Programming bugs or logical errors: checked exceptions. External factors the program cannot control: unchecked exceptions.
Why. The two categories are reversed.
AC. Programming bugs or logical errors: unchecked exceptions. External factors the program cannot control: checked exceptions.
2. Instance v Static 04 (September 11, 2026)
Q. True or false: the following is a valid, compiling method signature.
public static methodName(int param)WA. A. True.
Why. The method declaration is missing a return type.
AC. False. Example: public static void methodName(int param).
3. Test Case Design 02 (September 9, 2026)
Q. Method input: an index into a given array, with length > 2. Which of the following inputs represent a border case? Select all which apply.
WA. A. -1; F. array.length + 1.
Why. These choices miss the valid endpoints; array.length + 1 is beyond the first invalid index.
AC. Valid endpoints: 0 and array.length - 1. Immediately outside the valid range: -1 and array.length.
Note. The full options and official answer are not visible, so the exact required selection is unconfirmed.
4. compact 01 (September 4, 2026)
Q. True or false: this array is COMPACT. (Sentinel value: -1)
[5, 2, -1, -1, -1]WA. B. False.
Why. All valid elements are at the beginning, with no gaps.
AC. True.
5. 2d array initialization 2 (September 2, 2026)
Q. How about:
int[][] numbers = new int[2][];WA. D. This line of code will not compile.
Why. Java allows the inner arrays to remain unallocated.
AC. The code compiles; numbers contains [null, null].