← All topics
Quiz: Java Methods: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What does this print? (code)
- Q2. Which pair is valid overloading?
- Q3. What does this print? (code)
- Q4. Is Java pass-by-reference?
- Q5. What does sum(int... nums) receive as nums when called as sum(1, 2, 3)?
- Q6. What does this print? (code)
- Q7. What does this print? (code)
- Q8. What does this print? (code)
- Q9. Which varargs declaration is valid?
- Q10. Inside class Main, why can main call square(7) without creating an object?