← Quiz: Java Methods: all 10 questions
Quiz: Java Methods · Question 4 of 10
Is Java pass-by-reference?
Is Java pass-by-reference?
- A.Yes, for objects
- B.Yes, always
- C.No — it is always pass-by-value (object references are passed by value)
- D.Only for arrays
Answer & explanation
Correct answer: No — it is always pass-by-value (object references are passed by value)
Java copies values. For objects, the copied value is a reference.
Can you get the rest right without peeking?
Take the timed Quiz: Java Methods quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →