File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Static methods and variables
Joined: May 23, 2010
Jul 05, 2010 13:13:44
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.
Joined: Oct 27, 2005
Jul 05, 2010 13:17:05
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
Joined: Jun 01, 2010
Jul 05, 2010 13:18:22
You are not overriding them, just creating methods and variables with the same name.
I agree. Here's the link:
subject: Static methods and variables
Overriding in Static Methods
How to access static variable directly from jsf page
Inherited main method question
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014