IntelliJ IDEA
 
Get IntelliJ IDEA

Extract parameter

Last modified: 08 October 2024

The Extract Parameter refactoring lets you extract a new parameter to a method.

You can also use the Extract Functional Parameter refactoring. In this case, IntelliJ IDEA analyzes the selected code, finds out what the method signature would be for the extracted fragment, finds all functional interfaces with this method signature and wraps the code fragment with an anonymous class based on the selected interface and uses this anonymous class as a parameter.