aspose file tools*
The moose likes Beginning Java and the fly likes Java Basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Basics" Watch "Java Basics" New topic
Author

Java Basics

NIKHIL JAIN
Greenhorn

Joined: May 29, 2001
Posts: 6
WHY ABSTRACT METHODS CANNOT BE STATIC??
sona gold
Ranch Hand

Joined: Feb 14, 2001
Posts: 234
because the implementation for every instance of the abstract class would be different
thats the whole idea of abstract classes

sona<br />SCJP
Jyotsna Clarkin
Ranch Hand

Joined: Jan 26, 2001
Posts: 158
Abstract methods are designed as a template for subclasses methods. These methods must be implemented by the subclasses. Abstract methods support dynamic binding. Thus the correct implementation will be invoked at run-time.
Static methods are class-specific. Thus a static method is one whose implementation is the SAME for all objects of a particular class. You cannot provide implementation for methods of a different class even if it happens to be a subclass
Static methods are bound at compile time based on the type of the reference, not at run time based on the class of the object.
So static methods will NOT show polymorphic behaviour.
 
 
subject: Java Basics