ContactUs :

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Can u overload the main() ?

Yes, any Java method can be overloaded including the main() method. The Java interpreter will only invoke the standard entry point signature for the main() method, with a string array argument, but your application can call its own main() method as required.

class test
{
            public static void main(String []asdff)
            {
                       
                        test.a();
                       
            }
            public static void main(int a,int b)
            {
                        System.out.println("over loaded");
            }
            static void a()
            {
                       
                        test.main(1,2);
            }
}
Related Posts Plugin for WordPress, Blogger...
Flag Counter