aspose file tools*
The moose likes Beginning Java and the fly likes Overriding of Static Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Overriding of Static Method" Watch "Overriding of Static Method" New topic
Author

Overriding of Static Method

Faraz Alig
Greenhorn

Joined: Mar 14, 2010
Posts: 24
Is it possible to override the static method in subclass? If not then please explain why?


~ Faraz
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1618
    
  10

Have you tried? What happens?


When you do things right, people won't be sure you've done anything at all.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18138
    
  39


To be more specific, create a subclass object, cast it to its superclass type, and try to call the static method... which one gets call? the original super class one? or the subclass version?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Schumi Mic
Greenhorn

Joined: Apr 17, 2010
Posts: 4
@Faraz: You can find this in-detail @ Overriding Vs Hidding


SCJP 1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overriding of Static Method
 
Similar Threads
About overriding
can a static method be override.
tere is a ques abt static method.
Question
Float wrapper takes double primitive implicitly.