🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Methods: all 10 questions

Quiz: Java Methods · Question 4 of 10

Is Java pass-by-reference?

Is Java pass-by-reference?

  1. A.Yes, for objects
  2. B.Yes, always
  3. C.No — it is always pass-by-value (object references are passed by value)
  4. 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 →