The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


it does not get instantiated

Posted by saddy on January 30, 2001 at 12:53 PM

it does not get instantiated, the main method is a static metod and does not need an instance to get invoked, in can be invoked by the class name itself.
as about how it works even with private modifier than it is an accepted bug in Java u can check it from sun's site
hope this should clear ur doubt

> When we write a Java Application Program , we don't instantiate a public class. How is that class then instantiated ? Even with changing the main to private , the program compiles and runs successfully. Why does this happen ? Pl. send me the explanation.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us