-
Polymorphism vs overloading
- Compilation / Runtime (execution)
- Static / Dynamic
-
var is not dynamic typing
-
Inheritance vs composition
- extends vs implements
- Constructor chaining
-
Nested classes
- inner (non-static)
- qualified this
- static nested
- inner (non-static)
-
Generics
- Bounds and wildcards
- Compare to arrays
- Erasure
- Reifiable / Non-reifiable types
- cannot create instance of type parameter
- cannot create array of parameterized type
- cannot use instanceof / cast with parameterized type
- cannot overload with two different instantiations of the same parameterized type
- Reifiable / Non-reifiable types
- Raw-types -> do not use them
- With nested classes
- F-bounded polymorphism
- Bounds and wildcards
More info:
-
Naftalin & Wadler, Java Generics and Collections, Manning, 2006
-
Bloch, Effective Java, 3rd ed., Addison-Wesley, 2017
-
Evans, Clark, Verburg, The Well-Grounded Java Developer, 2nd ed., Manning, 2022
-
Spilka, Troubleshooting Java, Manning, 2023