Java Inheritance is a fundamental concept in OOP (Object-Oriented Programming). It is the mechanism in Java by which one class is allowed to inherit the features (fields and methods) of another class. In Java , Inheritance means creating new classes based on existing ones. Learn how to inherit attributes and methods from one class to another in Java using the extends keyword. See examples of subclass (child) and superclass (parent) relationships, and the final keyword to prevent inheritance . The main purpose of inheritance in java is to provide the reusability of code so that a class has to write only the unique features and rest of the common properties and functionalities can be inherited from the another class.