I thought final methods cannot be overridden. But the below code compiles just fine. Can somebody explain.
[ Added UBB [CODE] tags to add whitespace, improve readability ] [ May 14, 2002: Message edited by: Jessica Sant ] [ May 14, 2002: Message edited by: Sagar Salapaka ]
Joined: Aug 29, 2001
I think the f() method in WF is private which is accisible within only WF class. If you declare the f() in WF to be public or protected, you will get compile time error what you are expecting. The f() method declared in derived class is consided a brand new method which is no connection with the superclass. Guys, am i correct?
Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
Joined: Feb 06, 2002
Thanks a lot Thiru. It makes sense. Learnt something new today. Have a nice day!
Joined: Dec 20, 2001
Originally posted by Thiru Thangavelu: I think the f() method in WF is private which is accisible within only WF class...Guys, am i correct?
Yup, that's right. Private methods are not inherited. In fact, they're not even visible from outside the class, so you can't possible override or hide them. Corey