# Extract Variable dialog

> **TL;DR**
> `Refactor | Introduce Variable`
>
>
>
> `Ctrl+Alt+V` (Windows), `⌘ ⌥ V` (macOS), `⌘ ⌥ V` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ V` (macOS System Shortcuts), `Ctrl+Alt+V` (XWin), `Ctrl+Alt+V` (GNOME), `Alt+Shift+V` (KDE), `Ctrl+Alt+V` (Emacs), `Ctrl+Alt+V` (Sublime Text), `Ctrl+Alt+V` (Sublime Text (macOS)), `Alt+Shift+V` (NetBeans), `Ctrl+R, V` (Visual Studio), `⌘ R, V` (Visual Studio (macOS)), `Alt+Shift+L` (Eclipse), `⌘ ⌥ L` (Eclipse (macOS))
>
>
>
> The how to section: [Extract/Introduce variable](extract-variable.html)

Generally, this dialog is used to extract new variables. Depending on the language, there may be additional options.

* In Java, you can declare the new variable `final`. To make this dialog accessible for Java, you have to disable [in-place refactoring in the editor settings](code-editing.html#in_place_refactorings).

* In JavaScript, you can select to extract a (global) variable or a constant. For JavaScript 1.7, JavaScript 1.8.5, ES5, and ES6, there is also an option of extracting a local variable.

| Item | Description | Language |
| --- | --- | --- |
| Variable of type | The type of the new variable. | Java |
| Name | Specify the name for the new variable. | All |
| Replace all occurrences | Select this option to replace all the occurrences of the selected expression (if more than one occurrence of the selected expression is found).  | All |
| Declare final | Select this option to declare the new variable `final`. | Java |
| Declare var type | Select this option to declare the introduced variable with `var` instead of an explicit type, when local variable type inference is available. | Java |
|  |    Choose how to extract the variable:       * var: extract a global variable.    * const: extract a constant.    * let: extract a local variable. The let option is available only for JavaScript 1.7, JavaScript 1.8.5, ES5, and ES6.     | JavaScript |

## See also

### Procedures

[Extract/Introduce variable](extract-variable.html)

### External Links

[ActionScript refactoring improvements in IntelliJ IDEA 10.5](http://blogs.jetbrains.com/idea/2011/05/actionscript-refactoring-improvements-in-intellij-idea-105/#more-5445)

