X
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 9 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 138,375 times.
Learn more...
If you've ever tried to alter a variable's name manually, you'll know that it's a tedious process. In order for the program to compile, all occurrences of the variable must be found and changed to the new name. However, Eclipse makes this task extremely easy by providing a re-factoring tool that automatically finds and updates variable names. The build used here is Eclipse Ganymede 3.4.0.
Steps
-
1Highlight and right click on the variable you want to rename. Navigate to Refactor and select Rename....
-
2Type in your new variable name and press Enter.Advertisement
-
3Verify that occurrences of the variable are updating as you type.
-
4Check through the source code to ensure that no errors have arisen.
Advertisement
Warnings
- If there are any syntax errors near occurrences of your variable, those occurrences may not re-factor correctly since Eclipse will not know how to handle the errors. Always check problematic areas after refactoring.⧼thumbs_response⧽
Advertisement
About This Article
Advertisement