IntelliJ IDEA Tips & Tricks #4: Extract Methods with Alt + Cmd + M

Опубликовано: 01 Октябрь 2024
на канале: CodeOpsTech
561
0

Extracting helper methods from existing methods is a simple and effective refactoring to reduce code complexity and size.

In IntelliJ IDEA, select the lines you want to extract into a method and select "Alt + Cmd + M" and choose the name of the extracted method. IntelliJ will automatically replace the code with a method call - taking care of parameters and return types.