The purpose of inheritance in Java is to provide a way to create new classes that are based on existing classes. This allows you to reuse existing code, reduce the amount of duplicated code, and promote code modularity and organization.