• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why abstract methods cannot be static?

 
Leonardo Crespo
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple one:

Why abstract methods cannot be static?



Thank you very much.

Leonardo.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abstract methods must be overriden in the concrete child class that extends this abstract class. But static methods cannot be overriden , it dosen't involve in polymorphic behaviours, it belongs to a particular class and not to a instance. Hence it cannot be combined with abstract methods.
[ July 28, 2005: Message edited by: Srinivasa Raghavan ]
 
Leonardo Crespo
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow Srinivasa , you were fast! Thanks for the explanation!
 
Arulkumar Gopalan
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but, static methods can be separately overridden though, which is class specific.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic