This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Basics

 
NIKHIL JAIN
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHY ABSTRACT METHODS CANNOT BE STATIC??
 
sona gold
Ranch Hand
Posts: 234
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because the implementation for every instance of the abstract class would be different
thats the whole idea of abstract classes
 
Jyotsna Clarkin
Ranch Hand
Posts: 158
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic