Explain the concept of inheritance in Java.
Inheritance is a fundamental concept in Java that allows a new class (subclass or derived class) to inherit properties and behaviors (fields and methods) from an existing class (superclass or base class). This promotes code reusability and hierarchical organization. The subclass can extend the functionality of the superclass by adding new methods or overriding existing ones.