Loading…
Loading…
Ten exam-style questions on pass-by-value for primitives and references, mutating versus reassigning parameters, ignored return values, autoboxing and unboxing rules, widening versus boxing, null unboxing and wrapper equality, with explanations.
Practice questions for the article Java Pass-by-Value, Returning Objects and Autoboxing.
The questions follow Java 21 rules, as on the 1Z0-830 exam. For each method call, ask whether the method mutates a shared object or only reassigns its own parameter. Aim for at least 8 out of 10 before moving on.
Quiz path: step 33. Take the quizzes in this order, after reading each article.
Previous quiz: static Members, Static Initializers and Static Imports (OCP 21)
Next quiz: Method Overloading and Overload Resolution (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.