Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract modifier can never be combined with the static modifier

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I have read while googoling....the abstract modifier can never be combined with the static modifier...!! please explain with short example..!

 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know what abstract means?

Do you know what static means?

Are you aware that static methods cannot be overridden?
 
Gaurav Raje
Ranch Hand
Posts: 136
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a profesor, who used to say, static is the opposite of abstract... just to emphasise this exact point...


While not entirely true, it helps if you think this way.
 
David Kay
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abstract methods need to provide an implementation in one of its sub-classes or a compiler error is thrown, however if you make an abstract static method then there is no way to provide any implementation since static methods can't be overridden in a sub-class.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic