| Author |
static method
|
manas ranjan mandal
Ranch Hand
Joined: Apr 02, 2008
Posts: 97
|
|
hi i want to know that can i declare static method inside abstract class? thanks in advance
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
|
What would prevent you from doing so ? (please consider asking this kind of question to the beginner forum).
|
[My Blog]
All roads lead to JavaRanch
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32838
|
|
I agree with Christopher this sounds like a beginner's question. You implement a static method exactly the same way in any class; remember you can't override static methods; look at this FAQ, and ask again if there's anything you don't understand.
|
 |
anu kuntala
Greenhorn
Joined: Sep 25, 2008
Posts: 17
|
|
Hi Manas, Yes we can declare static methods in Abstract classes. You won't get any compiler error. But you cannot declare a method as both abstract and static. Because static methods cannot be overriden. Regards, Anu
|
 |
 |
|
|
subject: static method
|
|
|