It's not a secret anymore!
The moose likes Beginning Java and the fly likes about abstract and static Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about abstract and static" Watch "about abstract and static" New topic

about abstract and static

Santhi Bharath
Ranch Hand

Joined: Jun 03, 2008
Posts: 75
why we cant use abstract and static keywords to a method at a time

thanks and regards<br />Santhi Bharath<br />SCJP 5.0, SCWCD 5.0
Marco Ehrentreich
best scout

Joined: Mar 07, 2007
Posts: 1294

Hi Santhi,

welcome to the JavaRanch

An abstract method can't be static because you can call any static method (even without having an object instance of the corresponding class). But you aren't allowed to call abstract methods because they don't have an implementation. Abstract methods are only method prototypes - a skeleton for methods.

For this reason it doesn't make sense to have a method which is both - static and abstract!

I agree. Here's the link:
subject: about abstract and static
jQuery in Action, 3rd edition