Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about abatract  RSS feed

 
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!