You can create classes that are enclosed in other types (i.e., nested classes).
1. |
Open the New Class wizard. See Opening the New Class Wizard |
2. |
If a folder is found for the current selection, that folder appears in the Folder field as the container for the new class. ![]() Edit the Folder field as needed to indicate in which folder you want the new class to reside. You can either type a path or click the Browse button to find the folder. |
3. |
Check the Enclosing Type box. In the Enclosing Type field, type the name of the enclosing type or click the Browse button to select the enclosing type for the new class. |
4. |
In the Name field, type a name for the new class. |
5. |
Select the desired access modifier by using the Access Modifiers radio buttons.
|
6. |
Select the type modifiers for the new class by checking and clearing the appropriate check boxes:
|
7. |
In the Superclass field, type or click Browse to select a superclass for the new class. |
8. |
Click the Add button to add interfaces for the new class to extend. |
9. |
If you want to create some method stubs in the new class:
|
10. |
Click Finish when you are done. Note: The new class is created in the same compilation unit as its enclosing type. |