| 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: 19232
|
|
|
That's called shadowing or hiding. See Overriding vs Hiding.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
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.
|
 |
 |
|
|
subject: Static methods and variables
|
|
|