The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
May 2000

Advertisement

Advertisement

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.

Message:

Reg. public.static.void.main()

Posted by Vamsi Sudha on January 17, 2001 at 5:47 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.



Replies:

Sponsored Links



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