Immediate feedback is provided upon selecting an answer.
1. Which statement correctly declares and initializes an object named `desk` from the `Furniture` class?
2. What is the primary purpose of a **Constructor** in a Java class?
3. What is an **Instance** of a class?
4. Which access modifier restricts a member to be accessible only within the class it is declared in?
5. What does the keyword `this` refer to inside a non-static method?
6. A variable declared with the keyword `static` means:
7. If class `Dog` is a subclass of class `Animal`, what keyword must `Dog` use in its declaration?
8. What is the keyword used by a subclass to call a constructor of its immediate superclass?
9. Which members of a superclass are NOT inherited by the subclass?
10. **Polymorphism** in inheritance primarily allows an object to take on how many forms?
11. What is the process of defining a method in a subclass with the same signature (name, parameter list) as a method in its superclass?
12. What is the root class of all classes in Java?
13. How many times will this loop execute?
for (int i = 5; i > 0; i--)
14. What statement is used to immediately stop the innermost loop and continue execution after the loop?
15. What statement is used to skip the current iteration of a loop and move to the next iteration?
16. The **do-while** loop checks the condition at what point?
17. A **while** loop is best suited for situations where:
18. What will be the value of `x` after this code runs?
int x = 0; while(x < 3) { x++; }
19. The **enhanced for loop** (`for-each`) is ideal for iterating over:
20. Which of the following is an example of an **infinite loop**?
21. What happens if the `break` statement is omitted in a `switch` case?
22. Which two data types are NOT allowed as the expression in a standard Java `switch` statement?
23. The `default` block in a `switch` statement executes when:
24. Which logical operator represents the **OR** operation in Java?
25. In Java, is the `else` block in an `if-else` statement mandatory?
26. Which of the following conditional expressions checks if `x` is **NOT equal** to `y`?
27. What is the correct way to chain multiple `if` checks in Java?
28. Which keyword is used to represent the opposite (negation) of a boolean condition?
29. What is the value of `result`?
boolean result = (5 > 3) && (2 < 1);
30. The Java Ternary Operator (`? :`) is an equivalent shorthand for: