Day 7 - Building A Pen Color Button using Inheritance

Опубликовано: 24 Май 2026
на канале: Bloom Institute of Technology
87
1

Introduction
We've now seen how we can create classes in Java and use them to instantiate objects in our program. In the previous lesson, we used a class to define a button which clears the sketchpad.

This time, we will discuss class inheritance and how we can expand on an existing base class to make specialized versions of the class that perform slightly differently.

Key Concepts
Inheritance
Overriding Methods
Using super

Lesson Overview
In this lesson, we will refactor our existing ClearButton into a generic SquareButton class. We'll then see how we can use Inheritence to expand this class in order to both rebuild our ClearButton class, and create a new PenColorButton.

Learn more - https://replit.com/learn/bloomtech-sk...