Item 16 of the effective Java 2 version, placing the structure on heritage the following is called
"If Superclass receives a new method in the release later and you have a misunderstanding to provide the subclass a method with the same signature and a different return type, then your subclass will no longer be compiled. / P>
If you sign a sub-signature with a single signature and return method Rakar new Suprpeles method has, as you are now able to override it "
This case how is it possible that it occur in a real-world situation? Can someone give an example from a real business app (if necessary, to remove ownership information)?
It is not about how possibly is the scenario (Apart from this, I am sure you have heard)
It is about the fact that there is very little of a binding contract with heritage heritage
Ties between heritage classes There is a very strong way to do it, and basically you should use that strong connection in item 16 states, when it becomes clear that it is necessary Wh. For all other uses, structure should be given priority.
Comments
Post a Comment