Renaming a class or an interface

You can rename a class or an interface by modifying its declaration in the compilation unit in which it is declared. However, if you also want to update all references to it, do one of the following:

  1. In a Java view presenting classes and/or interfaces (e.g. the Outline view, the Type Hierarchy views, etc.) select a class or interface.

  2. From the class' or interface's pop-up menu, select Refactor > Rename or use the Refactor > Rename action from the global menu bar.
or

  1. In a Java editor, select a reference to the class or interface.

  2. From the editor's pop-up menu, select Refactor > Rename or use the Refactor > Rename action from the global menu bar.

Related concepts

Java projects

Related tasks

Creating a new Java class
Creating a nested interface
Creating a top-level interface
Creating a top-level class
Creating a nested class
Creating a class in an existing compilation unit

Related reference

Package Explorer
Refactoring actions
Refactoring dialogs
Refactoring preferences

Legal notices