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

question about abatract

 
michael wang
Ranch Hand
Posts: 35
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
exactly clear,thanks Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic