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

Static methods and variables

Neelima Mohan
Greenhorn

Joined: May 23, 2010
Posts: 27
I am able to access my static variables and methods declared/defined in the superclass from my subclass, then why is it said that static methods cannot be overridden? I can easily override that method in my subclass.

Thanks,
neelima
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19794
    
  20

That's called shadowing or hiding. See Overriding vs Hiding.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
You are not overriding them, just creating methods and variables with the same name.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static methods and variables