aspose file tools*
The moose likes Beginning Java and the fly likes How can we call a method without  class Object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How can we call a method without  class Object?" Watch "How can we call a method without  class Object?" New topic
Author

How can we call a method without class Object?

Jalli Venkat
Greenhorn

Joined: Aug 10, 2006
Posts: 27
How can we call a method from the class without creating the class Object?
Can you explain me the what are the alternative ways to call methods without Object?

Venkat


venkat
ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
If the method is "instance method" then it is tight to instances of the class, so you need an instance of the class to invoke such method.

If the method is "class method" i.e static, you can use the class name directly to invoke such method, you dont need an object of the class, but its still valid to call static methods on an object but then the compiler will substitute the class name.
 
 
subject: How can we call a method without class Object?