Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about abatract

 
michael wang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why abstract method can not be static or private?
thanks
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An abstract method can't be private because there would be no way for a subclass to implement it! It would not be inherited by any subclasses, so there would be no way to provide a body for it.

Static methods cannot be overriden by a subclass; they can be hidden, but not overridden. Therefore, there is no way to provide an implementation for the superclass.
 
michael wang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exactly clear,thanks Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic