▶ Learn in 1 minute: Spring Programming

  • 20.11.2026 11:20:19
  • İbrahim Gökyar

We move to inheritance, one of the core principles of object-oriented programming. Using the extends keyword, we derive an empty Mother class from the Person class. Without writing a single line in the Mother class, we see that an object created from it can access the public variables and methods (firstName, lastName, sleep) defined in Person.

Spring Boot from Scratch episode 7 is available on the Opendart Akademi YouTube channel. This series is prepared from the recorded lessons of our Java Spring Boot course; we start from Java fundamentals and progress toward Spring Boot.

▶ Watch the lesson on YouTubeAll episodes in the series

What's in this lesson?

  • 00:00 Introduction
  • 00:03 Creating the Mother class
  • 00:30 "Mother class is derived from Person": extends Person
  • 01:31 Creating an object from the derived class
  • 02:10 Mother object in the test class
  • 02:45 Variables and methods inherited from the parent class
  • 03:18 Accessing a.firstName, a.lastName and calling methods
  • 04:14 Method runs without writing any code
  • 04:58 Go to definition: Ctrl + click
  • 05:19 How the compiler reads inheritance
  • 06:00 Everything public is inherited by the subclass
  • 06:53 Test yourself: print three messages using inheritance (run)
  • 08:45 Closing

Opendart Akademi

Learn Spring Boot with an instructor in live lessons

These videos are from the recorded lessons of our Java Spring Boot course. The full course covers Java, Spring Boot, REST API, databases, and real projects; you can ask the instructor when you get stuck.

View the course →Free consultation: WhatsApp

← Previous episode: if, else if, else in Java: Decision Making with Conditions (with Debug) · Playlist: Spring Boot from Scratch · Subscribe on YouTube

Instructor: İbrahim Gökyar (Opendart Akademi)

📚 Learn this topic with Opendart: Java Spring Boot FullStack Training · YouTube video lessons · Subscribe