oop-inheritance-composition

Installation
SKILL.md

OOP Inheritance and Composition

Master inheritance and composition to build flexible, maintainable object-oriented systems. This skill focuses on understanding when to use inheritance versus composition and how to apply each effectively.

Inheritance Fundamentals

Basic Inheritance in Java

// Base class with common behavior
public abstract class Vehicle {
    private String brand;
    private String model;
    private int year;
    protected double currentSpeed;

    protected Vehicle(String brand, String model, int year) {
        this.brand = brand;
        this.model = model;
Related skills
Installs
26
GitHub Stars
150
First Seen
Jan 22, 2026