| Author |
interface : Bug in K&B P-115
|
Sandeep Vaid
Ranch Hand
Joined: Feb 27, 2006
Posts: 390
|
|
Friends, At Page - 115 : So don't be fooled by code that shows a concrete class that declares that it implements an interface, but doesn't implement the methods of the interface. Before you can tell whether the code is legal, you must know what the superclasses of this implementing class have declared. If any class in its inheritance tree has already provided concrete (i.e., non-abstract) method implementations, and has declared that it (the superclass) implements the interface, then the subclass is under no obligation to re-implement (override) those methods. The line in bold is not correct. This line should be : and irrespective of it has declared that it (the superclass) implements the interface or not
|
 |
Matt Russell
Ranch Hand
Joined: Aug 15, 2006
Posts: 165
|
|
|
Logically, the K&B statement is correct (as is yours), and it is not (IMO) even misleading...no reader would be tempted to believe that if a superclass does not declare that it implements an interface, then the subclass is obliged to provide implementations for the interface methods!
|
Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
|
 |
Venkat Sidh
Ranch Hand
Joined: Sep 30, 2006
Posts: 61
|
|
Sandeep, Bert has already fixed this point. Please refer Bert's K & B, SCJP 5 - Errata: Updated 7/28/06.
|
 |
Sandeep Vaid
Ranch Hand
Joined: Feb 27, 2006
Posts: 390
|
|
|
Thanks
|
 |
 |
|
|
subject: interface : Bug in K&B P-115
|
|
|