Anton Suprun

Jun 18, 2021

5 min read

What is inheritance in Java?

Photo by Tracy Adams on Unsplash

In Java, a class can be derived from an existing class and when that happens, the derived class inherits the fields and the methods from that existing class. In Java, and many other languages, this is called inheritance. The class that is derived from an existing class is often referred to as the subclass or child class. The class that is being derived from is called the super class or the parent class.