Eclipse Creating a Java Class
Opening the new Java class wizard
You can use the new Java class wizard to create a Java class. You can open the Java class wizard in the following ways:
- Click the "File" menu and select New > Class
- Right-click in the Package Explorer window and select New > Class
- Click the class drop-down button (
) and select (
)
Before opening the create Java class wizard, it is best to select the package name the Java class belongs to, so that the package field will be filled in automatically when creating the Java class.
Using the new Java class wizard
In the Java class wizard dialog, you can perform the following operations:
-
Confirm that the folder name (Source Folder) and package name (Package) are correct
-
Enter the class name
-
Select other modifiers for the class
-
Enter the name of the superclass (Superclass) or click the Browse button to select an existing class
-
Click the Add button to select the interfaces the class implements
-
In the check boxes, you can select the method creation method and whether to automatically generate comments
-
Click the Finish button
Viewing the new Java class
In the Package Explorer view, we can see the new class, and we can modify the code through the Java editor on the right.