Create your account

Already have an account? Login here

Note: By joining, you will receive periodic emails from Coursetro. You can unsubscribe from these emails.

Create account

69. Inheritance Example

Getting Started with Java

Woah, wait a second..

This is a 100% free course, but we need you to first join or login to watch this video.

Alright, join or login here.

This video shows an example of inheritance in Java. Create a Shape superclass and extend a Rectangle from it. Create a Square that extends from the Rectangle. Add a display() method and a getArea() method to the Shape class. We can access these methods from the object of a Square or Rectangle as these methods are inherited.

Course Cirriculum