# OOP Inheritance

In this chapter, we will discuss the second pillar of object-oriented programming, `inheritance`. 
**Image:** OOP Pillars – Inheritance

Updated: November 16, 2026

## [DRY Code](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/dry-code)

1. [DRY Code](https://www.ask-codey.com/lessons/dry-code) (Novice): Classes that repeat the same variables and methods break the DRY principle, and merging them into one class is not the answer.

## [Introduction to Inheritance](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/introduction-to-inheritance)

1. [Introduction to Inheritance: an overview](https://www.ask-codey.com/lessons/introduction-to-inheritance-an-overview) (Apprentice): Inheritance is an is-a relationship, where a child class such as Archer gets all the variables and methods of its parent class, Character, and adds its own.
2. [Generalization vs Specialization](https://www.ask-codey.com/lessons/introduction-to-inheritance-generalization-vs-specialization) (Apprentice): Generalization moves what classes share into one parent class, and specialization keeps what makes each child class different.
3. [Inheritance in Java](https://www.ask-codey.com/lessons/introduction-to-inheritance-inheritance-in-java) (Apprentice): In Java, a child class inherits from a parent class with the extends keyword and then adds its own variables and methods.
4. [Inheritance and Constructors](https://www.ask-codey.com/lessons/introduction-to-inheritance-inheritance-and-constructors) (Journeyman): When a parent class has only constructors with parameters, the child class's constructor must call super(...) with those values as its first line.
5. [Overriding Methods](https://www.ask-codey.com/lessons/introduction-to-inheritance-overriding-methods) (Journeyman): Override an inherited method with @Override and call super to keep the parent's logic while adding your own.

Source: https://www.ask-codey.com/courses/java-full-stack-bootcamp/chapters/oop-inheritance
