Hello, while studying overriding stuff I was a little confused, because literature is contradictory. Can anybody help me through? Can I override methods: static - to be nonstatic static - to be static nonstatic - to be nonstatic (I think yes) non static - to be static Any suggestion where this make sense in programs? Thanks Tina
Hi Tina, Static method cannot be overridden( to non static). But i guess u can hide a static method inside a sub class i.e you can declare a static method in the subclass with the same signature as a static method in the superclass. [ December 16, 2002: Message edited by: girish rateshwar ]
In the JavaRanch Newletter there is an article called The Games Objects Play which has a section on Hide and Seek. That lists all the combinations of methods trying hiding and overriding and what happens if you try to do them. Have Fun!!
"JavaRanch, where the deer and the Certified play" - David O'Meara
posted 15 years ago
thanks for the help. The games play (hiding/Overriding) was pretty good. It helped me to pass the SCJP2 Exam on 10.1.03. Thanks a lot Tina :roll: