🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: References and Functions: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. Which is true about references?
  3. Q3. How should a function receive a large vector it only reads?
  4. Q4. What does this print? (code)
  5. Q5. Two functions named area(int) and area(int, int) in the same program is an example of:
  6. Q6. What does this print? (code)
  7. Q7. Where must default arguments appear in a parameter list?
  8. Q8. What does this print? (code)
  9. Q9. Can two overloaded functions differ only in their return type, like int get() and double get()?
  10. Q10. Why is an inline function safer than a function-like macro such as define SQ(x) xx?