#default-methods #horstmann-java8-for-really-impatient #java #java8
you can’t define a default method for toString or equals, even though that might be attractive for interfaces such as List. As a consequence of the “classes win” rule, such a method could never win against Object.toString or Object.equals.
If you want to change selection, open original toplevel document below and click on "Move attachment"
Parent (intermediate) annotation
Open itYou can never make a default method that redefines one of the methods in the Object class. For example, you can’t define a default method for toString or equals, even though that might be attractive for interfaces such as List. As a consequence of the “classes win” rule, such a method could never win against Object.toString or Object.equals.Original toplevel document (pdf)
owner:
piotr.wasik - (no access) - Java 8 for the Really Impatient (Horstmann), p16
Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details