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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Static mmbers " Watch "Static mmbers " New topic
Author

Static mmbers

jack worthing
Greenhorn

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

Joined: May 12, 2008
Posts: 229
I'm not quite sure what you mean:

Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3169
    
  10
You could however create an instance of the StaticTest class and then access the fields/call the methods using that
[ December 02, 2008: Message edited by: Joanne Neal ]

Joanne
Paul Yule
Ranch Hand

Joined: May 12, 2008
Posts: 229
Jack, perhaps your confusion is that you are creating non-static variables inside the static method and calling non static methods/variables on those instances, like Joanne said. The main method does indeed act like every other static method though.
jack worthing
Greenhorn

Joined: Dec 02, 2008
Posts: 18
thankyou for concern
i'm answerd .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static mmbers
 
Similar Threads
static
static and non-static synchronized methods
understanding static
Static mmbers
non-static variable cl cannot be referenced from a static context