Inheritance and polymorphism are closely related in Java. Inheritance provides a way to create a new class based on an existing class, and polymorphism provides a way to write code that can work with objects of different classes that share a common interface.