| Author |
Overriding final methods
|
Srinivasa Raghavan
Ranch Hand
Joined: Sep 28, 2004
Posts: 1228
|
|
Normally methods declared as final cannot be overriden for security / design reasons. But when a method declared as "private final" can be overriden in the child class. Do we get this behaviour since private members are not accessible in child ? [ February 17, 2005: Message edited by: Srinivasa Raghavan ]
|
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
|
 |
Chengwei Lee
Ranch Hand
Joined: Apr 02, 2004
Posts: 884
|
|
Private methods in the parent class are not in inherited by the child classes. Hence, having methods of the same signature as well as being declared private & final does not equate to method overriding. HTH
|
SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
|
 |
Kris Lightsey
Greenhorn
Joined: Feb 03, 2005
Posts: 25
|
|
|
And it is not just a question of semantics. Overridden methods will show polymorphic behavior but redefining private methods with the same name and signature will not.
|
 |
 |
|
|
subject: Overriding final methods
|
|
|