• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Java Basics  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHY ABSTRACT METHODS CANNOT BE STATIC??
 
Ranch Hand
Posts: 234
  • 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
 
Ranch Hand
Posts: 158
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!