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
10
×
24. Which access modifier allows visibility only within the same class? (2)
C
Oops!
Check
Okay!
Check
20
×
6. What is the output? (2)
5 (int is primitive â assignment copies the value. Changing y does not affect x.)
Oops!
Check
Okay!
Check
15
×
16. Given String s1 = new String("hi"); String s2 = "hi";, what is s1 == s2? (3)
B (new String("hi") creates a separate object on the heap; s2 references the interned literal)
Oops!
Check
Okay!
Check
×
boom
Lose 50 points!
Oops!
×
gold
Win 50 points!
Okay!
×
rocket
Go to first place!
Okay!
×
baam
Lose 20 points!
Oops!
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
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
×
lifesaver
Give 15 points!
Oops!
×
star
Double points!
Okay!
×
fairy
Take points!
5
10
15
20
25
×
baam
Lose 5 points!
Oops!
10
×
11. Which keyword refers to the current instance inside an instance method or constructor? (2)
C. this
Oops!
Check
Okay!
Check
×
seesaw
Swap points!
Oops!
×
seesaw
Swap points!
Okay!
×
fairy
Take points!
5
10
15
20
25
×
lifesaver
Give 15 points!
Oops!
15
×
1. Which Java keyword is used to create a new object (an instance) of a class? (1)
C. new (Example: Dog d = new Dog();)
Oops!
Check
Okay!
Check
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
5
×
Won 5 points
5
Oops!
Check
Okay!
Check
×
seesaw
Swap points!
Oops!
×
star
Double points!
Okay!
×
gift
Win 25 points!
Okay!
×
thief
Give points!
5
10
15
20
25
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
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
×
Restart
Review
Join for Free
;
Your experience on this site will be improved by allowing cookies.
Allow cookies