What will be the output of following quiz on varargs?
Method name can be same as class name, although its not a good practice.
If vararg parameter is present, it should be the last parameter in a method. So, the syntax is correct.
vararg is internally represented as an array, so we can access elements inside it using array notation.
Correct answer is “hello hello”
You may also like
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post