Loading…
Loading…
Ten exam-style questions on the scope of local variables, parameters, loop variables and fields, redeclaring names in nested blocks, garbage-collection eligibility, cycles, System.gc() and finalize(), with explanations.
Practice questions for the article Java Variable Scope and Garbage Collection.
The questions follow Java 21 rules, as on the 1Z0-830 exam. For garbage-collection questions, draw each reference as an arrow and move the arrows line by line. Aim for at least 8 out of 10 before moving on.
Quiz path: step 7. Take the quizzes in this order, after reading each article.
Previous quiz: Identifiers, Variable Initialization and var (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.