follow

Saturday, 27 July 2013

Method with varargs : JAVA Programming by "Gopal Krishna"

public class mwv
{
        public static void main(String args[])
    {
        test("India", "Delhi");
        test("United States", "New York", "California");
    }

    public static void test(String... args)
    {
            for(String arg: args)
            {
                System.out.print("name of Country Is: " +arg+"\n");
            }
    }
}

No comments:

Post a Comment