aspose file tools*
The moose likes Beginning Java and the fly likes Static mmbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Static mmbers

jack worthing
Greenhorn

Joined: Dec 02, 2008
Posts: 18
if static methods are restricted to call only staic methods and data,
how can main() be static and yet call any kind of methods or data.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Jack,

Welcome to JavaRanch!!!

How do you find your statement to be correct?
Can you come up with an example?

Static method can't access non-static method or instance member, because
there is no "this" reference in it. The same applies to main() method also.


cmbhatt
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3646
    
  15
Can we carry on the discussion of this question in this duplicate post


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static mmbers