public static final abc() is a valid method I cannot understand what signify to makes static method a final .Anyhow a static method cannot be overridden.
Can anyone explain why we declare a static method final.
thanx in advance
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
It stops you from declaring a static method with the same name and parameter types in a derived class. Why do this? I don't see the need for it and I've never seen it used. Does anyone do this?
There is no emoticon for what I am feeling!
faisal usmani
Ranch Hand
Joined: Jan 14, 2006
Posts: 139
posted
0
no idea !!! :roll:
There is no duty more obligatory than the repayment of kindness. [ May 11, 2006: Message edited by: faisal usmani ]
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
This might be a reason for someone to make a static method final:
The call to f() im main resolves to A's version of f, but when you uncomment B's version of f, it hides A's f. I'm not worried about this because I think I'm careful when I invoke a static method to use the name of the class that introduces it. [ May 11, 2006: Message edited by: Jeff Albertson ]