Difficulty: Easy
Correct Answer: 7 14
Explanation:
Introduction / Context:
This checks two ideas: primitives are passed by value, and static fields are shared across instances and can be set inside instance methods.
Given Data / Assumptions:
Concept / Approach:
Because primitives are passed by value, the caller's x does not change. However, setting the static variable s persists and can be printed later in main.
Step-by-Step Solution:
Verification / Alternative check:
Print x again after twice to confirm no change, and print s to confirm update.
Why Other Options Are Wrong:
They assume x changed in caller or that s was not updated.
Common Pitfalls:
Expecting call-by-reference semantics for primitives; misunderstanding static field scope.
Final Answer:
7 14
Discussion & Comments