A class or method used throughout the entire project can be renamed using the refactor tool. The refactoring make modifying the code easy for a developer by automatically updating all the required changes. In order to refactor the select class or method follow the procedure mentioned.
Open a
Java file -> select a
method or
class -> click
Refactor menu -> select
Rename as shown in the image below.
Now, a dialogue box appears known as
Rename Refactoring asking the user permission to rename the method, proceed by clicking
OK button as shown in the image below.
A dialogue box appears providing the new name option for renaming the selected method, click
Preview button to see the changes as shown in the image below.
Now, the dialogue box redirect and provide list of all the files that have been automatically changed and updated with the new method name and also provide comparison boxes before and after the changes, proceed by clicking
OK button in order to update the method name as shown in the image below.