"Static methods can be overridden by static methods only. " is Wrong, why is "Static methods cannt be overridden by non-static methods" correct ? i dont understand it, hope someone helps!!
Tony Sam<BR>One want to be a SCJP...
R K Singh
Ranch Hand
Joined: Oct 15, 2001
Posts: 5369
posted
0
Originally posted by Tony Sam:
why is "Static methods cannt be overridden by non-static methods" correct ? Because compiler won't allow you. "Static methods can be overridden by static methods only. " is Wrong. Because static methods are hidden not overridden. HTH CMIW
------------------ Regards Ravish
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
amit mawkin
Ranch Hand
Joined: Oct 31, 2001
Posts: 73
posted
0
I agree with ravish static methods are hidden and are not overridden in subclasses ------------------ coffee drinker ----------------------- Sun Certified Programmer for Java 2 Platform
Originally posted by ravish kumar: [b]why is "Static methods cannt be overridden by non-static methods" correct ? Because compiler won't allow you. "Static methods can be overridden by static methods only. " is Wrong. Because static methods are hidden not overridden. HTH CMIW [/B]
i know ,just one word : "Static method are not overridden." , is this OK?
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
yes it is, but they are hidden instead HIH ------------------ Valentin Crettaz Sun Certified Programmer for Java 2 Platform
Originally posted by Valentin Crettaz: yes it is, but they are hidden instead
does HIDDEN mean that the static method cant be accessed by the subclass?
Karen Leoh
Ranch Hand
Joined: Dec 03, 2001
Posts: 40
posted
0
The following statements are true.. but I hope someone can elaborate on them.. Static methods are never overridden. They are hidden or shadowed just like fields. Static methods cannot be shadowed by a non-static method and vice versa. Static method can be shadowed by a static method in the subclass. Can anyone one please elaborate what does hidden or shadowed means? What's the difference between the two?
--------------------<p>Karen Leoh<br />Sun Certified Programmer for Java™ 2 Platform