Inheritance is a mechanism in Java that allows you to create a new class based on an existing class. The new class inherits all the properties and behaviors of the existing class and can add or override them.