Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#default-methods #horstmann-java8-for-really-impatient #java #java8
Question
Can you define a default method for toString or equals and why? It might be attractive for interfaces such as List.
Answer
As a consequence of the “classes win” rule, such a method could never win against Object.toString or Object.equals.

Tags
#default-methods #horstmann-java8-for-really-impatient #java #java8
Question
Can you define a default method for toString or equals and why? It might be attractive for interfaces such as List.
Answer
?

Tags
#default-methods #horstmann-java8-for-really-impatient #java #java8
Question
Can you define a default method for toString or equals and why? It might be attractive for interfaces such as List.
Answer
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 it
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

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.