IntelliJ IDEA 2017.1 Help

Make Class Static

The Make Class Static refactoring allows you to convert an inner class into a static one, and automatically corrects all references to the class in the code.

To make a class static

  1. In the editor, place the cursor on the name of the inner class you want to make static, or select the class in the Structure view.
  2. On the main menu, or on the context menu of the selection, choose Refactor | Make Static.
  3. If the class references any outer class fields, the Make Class Static dialog suggests to pass the outer class as a parameter to the inner class constructor.
  4. Preview results in the Find tool window and apply changes.

See Also

Last modified: 18 July 2017