Team 1
0
Team 2
0
Teams
Name
Score
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Loading
20
×
10. What is the output? (3)
2 (Static field count is shared across all objects. Each constructor increments once)
Oops!
Check
Okay!
Check
×
seesaw
Swap points!
Oops!
×
rocket
Go to first place!
Okay!
×
fairy
Take points!
5
10
15
20
25
×
banana
Go to last place!
Oops!
20
×
7. What is the output? (2)
Fido (d1 and d2 refer to the same object â changing through one affects the other.)
Oops!
Check
Okay!
Check
10
×
5. Which of the following best describes encapsulation? (2)
B (Encapsulation uses private fields and public getters/setters or methods to control access)
Oops!
Check
Okay!
Check
×
eraser
Reset score!
Oops!
×
gold
Win 50 points!
Okay!
×
fairy
Take points!
5
10
15
20
25
×
lifesaver
Give 10 points!
Oops!
15
×
13. What does the expression a == b test when a and b are object references? (3)
B ( == compares references for objects. equals() can be overridden to compare content.)
Oops!
Check
Okay!
Check
15
×
4. Which statement about the main method is correct? (2)
B (JVM calls public static void main(String[] args) without creating an object, so main is static)
Oops!
Check
Okay!
Check
15
×
2. Which of the following is not a primitive type in Java? (1)
C. String
Oops!
Check
Okay!
Check
25
×
Won 25 points
25
Oops!
Check
Okay!
Check
10
×
12. Which is true about static fields? (2)
B (Only one copy of a static field exists per class loader; all instances share it)
Oops!
Check
Okay!
Check
×
eraser
Reset score!
Oops!
×
gold
Win 50 points!
Okay!
×
gift
Win 15 points!
Okay!
×
lifesaver
Give 10 points!
Oops!
10
×
11. Which keyword refers to the current instance inside an instance method or constructor? (2)
C. this
Oops!
Check
Okay!
Check
25
×
9. What is printed? (3)
70.0 (Withdraw subtracts from balance, leaving 70)
Oops!
Check
Okay!
Check
10
×
21. Which of the following is a valid reason to make a field private and use getters/setters? (2)
C (Private fields prevent arbitrary external modification; setters can validate values)
Oops!
Check
Okay!
Check
10
×
15. Given String s1 = "hi"; String s2 = "hi";, what is s1 == s2? (3)
B ( String literals are interned; identical literals refer to the same object in the string pool, so == is true)
Oops!
Check
Okay!
Check
15
×
3. What does a class represent in object-oriented programming? (1)
B (A class defines fields and methods. Instances (objects) are created from that blueprint.)
Oops!
Check
Okay!
Check
×
Restart
Review
Join for Free
;
Your experience on this site will be improved by allowing cookies.
Allow cookies