Write code to define method with Varargs
class Varargs { public static void main(String[] args) { hello(1,2,3,4,5);//from w ww. ja va2 s . co m } static void hello(int... values) { for(int i=0; i<values.length; i++) System.out.println(values[i]); } }