Using Inheritance to Save Code

# Introduction In this challenge, we will explore the concept of inheritance in Java. By using inheritance, we can extract common code from multiple classes and store it in a parent class. This not only saves development time but also promotes code reuse. We will design a class named `Person` and create two subclasses named `Student` and `Employee`. Each person will have a name and a phone number, with additional attributes specific to each subclass. We will override the `toString()` method in each class to display all the attributes.

|
60 : 00

Click the virtual machine below to start practicing