aspose file tools*
The moose likes Java in General and the fly likes abstract modifier can never be combined with the static modifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "abstract modifier can never be combined with the static modifier" Watch "abstract modifier can never be combined with the static modifier" New topic
Author

abstract modifier can never be combined with the static modifier

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

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

Joined: Jan 03, 2004
Posts: 6109
    
    6

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

Joined: Jul 23, 2010
Posts: 136
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

Joined: Mar 29, 2012
Posts: 5
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: abstract modifier can never be combined with the static modifier