Variable Arguments

Last Modified On : 21-Aug-2004

// Variable Arguments

public class VarArgs
{ 
     public static void main(String ...args)
     {
         for ( String s : args)
            System.out.println(s);

         print("one","two");
         print("One");

     }

     public static void print(String ...values)
     {      
         System.out.println("Parameters Passed");
         for ( String s : values)
             System.out.println(s);
     }
}