To introduce a new variable:
- Select variable in the Editor.
- On the main menu, chooseRefactoringIntroduce Variable
Tip: Alternatively, you can choose Refactoring->Introduce Variable
on the context menu.
- In the resulting dialog, specify the Name of the new variable. The new variable created is given the same type as the original variable.
- If desired, check Replace all occurrences. The Introduce Variable dialog indicates the number of occurrences that it will replace with the new variable.
Note: The refactoring does not replace any occurrences of the variable prior to the point in the code at which you selected to introduce the new variable.