Skip to content

Commit d1c8116

Browse files
author
Anass Rach
committed
Update answers!
1 parent d0d74ed commit d1c8116

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

_data/quiz/questions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@
312312
- "Dad"
313313
- "null"
314314
- "Mom"
315+
- None of the above
315316
correct: 1
316317
explanation: "TreeMap orders keys naturally. firstKey() returns the smallest key: Dad."
317318
category: "Collections"
@@ -435,6 +436,7 @@
435436
- "UsingClosedFinally"
436437
- "UsingClosed"
437438
- "FinallyClosedUsing"
439+
- None of the above
438440
correct: 2
439441
explanation: "Even when the resource is declared outside the try (Java 9+ feature), try-with-resources still calls close() after the try block completes. Then the finally block executes. So the output order is 'Using' (try body) → 'Closed' (resource auto-close) → 'Finally' (finally block)."
440442
category: "Exceptions"
@@ -656,6 +658,7 @@ options:
656658
- "5 11 5 Total: 12"
657659
- "5 10 0 Total: 8"
658660
- "4 11 0 Total: 7"
661+
- None of the above
659662
correct: 1
660663
explanation: "For loop runs twice: First iteration: ++parents makes parents=5, children=0+5=5, prints '5'. Second iteration: ++parents makes parents=6, children=5+6=11, prints '11'. While loop: children-- > 8 checks 11>8 (true), then decrements children to 10. Inside loop: uncles=10, children=10-10=0, uncles++ doesn't affect children, prints '0'. Next check: 0>8 is false, loop exits. Final: grandparents=2, parents=6, children=-1 (from the failed while condition). Total: 2+6+(-1)=7."
661664
category: "Operators and Control Flow"

0 commit comments

Comments
 (0)