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

Quiz: References and Functions · Question 7 of 10

Where must default arguments appear in a parameter list?

Where must default arguments appear in a parameter list?

  1. A.Anywhere in the list
  2. B.Only on the first parameter
  3. C.At the end: once a parameter has a default, every parameter after it needs one too
  4. D.Only in the function definition, never the declaration
Answer & explanation

Correct answer: At the end: once a parameter has a default, every parameter after it needs one too

Arguments are matched left to right, so only trailing parameters can be left out.

Can you get the rest right without peeking?

Take the timed Quiz: References and Functions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →