aspose file tools*
The moose likes Beginning Java and the fly likes Can we override static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can we override static method" Watch "Can we override static method" New topic
Author

Can we override static method

Pawan M
Greenhorn

Joined: Feb 23, 2008
Posts: 3
Hi,
I was reading queries posted by other so i got one doubt due to following sentences that
"You can "override" a non-final static method, although this is actually redefining it and hiding the original method."

but what i know that we can not override static method.
Am i correct or not,please clear my doubt? i have also created one program
but i am getting output-Overriden Meth
but in case of overriding it should print- Overriding Meth
Ravikanth kolli
Ranch Hand

Joined: Feb 10, 2008
Posts: 179

Static method cannot be overridden in java.
Detailed explanation is given at

Overriding Vs Hiding

Thanks
hope that helps


-kolli
Pawan M
Greenhorn

Joined: Feb 23, 2008
Posts: 3
Thank You very much.
Now i understood.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39869
    
  28
Welcome to the Ranch, "Pawan M," but please alter your displayed name to conform to the Ranch naming policy.
Abdul Aatif
Greenhorn

Joined: Feb 08, 2012
Posts: 23
Ravikanth kolli wrote:Static method cannot be overridden in java.
Detailed explanation is given at

Overriding Vs Hiding

Thanks
hope that helps



thank you very much
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can we override static method