This tutorial will cover rearranging code at a class and project level.

Rearranging Code

You often need to move elements of your code around. That might be statements or single lines, or rearranging a whole class to adhere to some code arrangement rules you and your team have defined. For example, you might have a team rule that private methods always appear last in a class - you can use IntelliJ IDEA to enforce that.

Moving Statements Around

Let's start off with one of the most common use cases for rearrange code - moving a statement around.