Learning paths

OOP in practice

Classes and constructors, overloading vs overriding, what really happens with a parent reference, interfaces vs abstract classes, composition over inheritance and object relationships.

  • For: You know the definitions of OOP and want to understand how it actually works and how to design with it.
  • By the end: You can design small class hierarchies sensibly and explain your choices in an interview.
  • Size: 10 lessons (31 min of reading, plus time to try the code), beginner to intermediate
  1. Encapsulation, inheritance and polymorphismObject-oriented programming, beginner, 3 min
  2. Method overloading vs overridingObject-oriented programming, beginner, 3 min
  3. What happens when a child object is assigned to a parent reference?Object-oriented programming, intermediate, 3 min
  4. Interfaces and abstract classes: the basicsObject-oriented programming, intermediate, 3 min
  5. Interface vs abstract class: when should I use which?Object-oriented programming, intermediate, 3 min
  6. Why prefer composition over inheritance?Object-oriented programming, intermediate, 3 min
  7. IS-A and HAS-A: association, aggregation and compositionObject-oriented programming, intermediate, 3 min
  8. equals(), hashCode() and the Object contractObject-oriented programming, intermediate, 3 min
  9. Immutable objectsObject-oriented programming, intermediate, 3 min

Other paths