# Converting a local variable to a field

To convert a local variable to a field:

- In a Java editor or in one of the Java views, select the local variable
- Do one of the following:
  - From the menu bar, select Refactor > Convert Local Variable to Field or
  - From the editor's pop-up menu, select Refactor > Convert Local Variable to Field

Refactoring actions
Refactoring dialogs
Java preferences