-
Renaming a class
I have a class in Eclipse. It has few constructor and objects of this class are being created in other classes. I now want to rename this class. How can I rename it in Eclipse so all its references are also changed accordingly.
Code:
public class Test {
public Test(){
...
}
public Test(int a){
...
}
public Test(float a){
...
}
}
-
I'm not sure if there is a way to change all references that easiy. If it is a public class, you will need to rename the java file (eclipse will automaticly rename the class file to match), and just use the Find/Replace to change all the references.
-
If you right click on the class name > go to Refractor > Rename.
That will rename all the occurrences in the project (optionally even in comments).
Or press Alt+Shift+R