The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
May 2000



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.


public static void main()

Posted by vikas on May 31, 2001 at 5:46 AM

> I have a question reg. public.static.void.main().

> main() method should be declared as static as we are accessing the
> method before instantiating.

> Then static methods can access only static methods and static
> variables as per Java rules.

> How is it possible for the public.static.void.main()
> to access non-static methods and variables ???
> I am a beginner and any help in this regard would be thankful.

> Regards,
> Vamsi Sudha.


Sponsored Links

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