IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Replace inheritance with delegation

Last modified: 11 February 2024

The Replace Inheritance With Delegation refactoring lets you remove a class from inheritance hierarchy, while preserving the functionality of the parent. IntelliJ IDEA creates a private inner class that inherits the former superclass or interface. Selected methods of the parent are invoked via the new inner class.