Skip to content

Building Objects the Right Way with Constructors

☕ Java 17

Every object starts its life in a constructor. Here you'll learn to write constructors, offer several ways to build the same object, reuse one constructor from another with this(), and build the parent part first with super() — including the call the compiler adds behind your back.

In this series

# Page Reading time
1 Writing and overloading constructors 3 min
2 Chaining with this() and super() 4 min
3 Lab: building movies for the catalog 3 min

🎓 OCP 1Z0-829 candidates: exam traps and practice questions (optional)

Prerequisites: Building Child Classes with this and super.

Code: Java17_Part_6_Object_Oriented_Basics on GitHub