File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes abstract methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "abstract methods" Watch "abstract methods" New topic

abstract methods

Puja S
Ranch Hand

Joined: Jan 06, 2005
Posts: 51

Can abstract methods be static ?

Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
An abstract method must be overridden and a static method cannot be overridden, so no.

Mike Gershman
SCJP 1.4, SCWCD in process
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
That's not quite right.
You can override a static method.

However you can not have a abstract static method.
This is because a static method can belongs to the class and must have implementation so when called with out instanciating an object of the class it will work. A abstract method however has no implementation so can't be static.
Jay Pawar
Ranch Hand

Joined: Aug 27, 2004
Posts: 411

That's not quite right.
You can override a static method.

You cannot override static methods, what seems to be overriding is actually hiding. Please refer this link
for details.

and here is one more excellent article by Corey
click me
[ January 06, 2005: Message edited by: Jay Pawar ]

Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.
Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1850

We cannot override static methods.
We can only hide the static methods.

Krishna Srinivasan
OCAJP 7/8 Exam, 400+ OCPJP Mock Questions
I agree. Here's the link:
subject: abstract methods
It's not a secret anymore!