Friday, July 27, 2012
In Java program execution starts from main method. And the main method should look like this public static void main(String[] args). Here it is declared static. This is due to following reasons :
1) It can be called directly by the class name without creating its instance.
2) If the class containing main have more than one constructor then JVM won't be able to understand which constructor to use while creating the object.
3) Again if there is a parameterized constructor in the class containing main then also JVM won't understand what value to pass while creating the object.


Post a Comment

Total Pageviews

Subscribe via Email


Popular Posts

About Me

My photo

I am a student of BTech Computer Science Engineering from RCCIIT,Kolkata. I am a crazy lover of Java and wants to settle as a Java developer. I have a seven years Java experience with an application developer experience for 2 years. Recently from March 2012 I am a registered S40 app developer for Nokia and has corrected an app of them. I am currently writing blogs to encourage and grow interest in all those who don't know or learning Java.