1. What is the purpose of using varargs in Java?
Ans. To pass a variable number of arguments to a method.
2. Which of the following is a valid declaration of a method that uses varargs in Java?
Ans. public static void myMethods(String str,int …..args).
