How to rename a class and its corresponding file in Eclipse?

Shift + Alt + r (Right click file -> Refactor -> Rename) when cursor is on class name. The file and constructors will be also changed.


You can rename classes or any file by hitting F2 on the filename in Eclipse. It will ask you if you want to update references. It's really as easy as that :)


Just right click on the class in the project explorer and select "Refactor" -> "Rename". That it is is under the "Refactor" submenu.


Right click file -> Refactor -> Rename.

Tags:

Java

Eclipse