Eclipse Creating Java Class
Till now we have learnt about the following important topics -
In this chapter we will be learning how to create a Java class
Eclipse Creating Java Class
We can create the Java Class using the following 3 different ways -
- By clicking on the File menu and choosing New > class
- By right clicking anywhere in the Project Explorer and selecting New > class
- By clicking on the New button (
) in the Tool bar and selecting class
Steps for creating Java class
Right click on the package explorer in the Eclipse Workspace and then select the class option
After selecting the class icon we need to fill following information that we have listed in the table -
Field | Explanation |
---|---|
Source/Folder Name | Provide the correct source name |
Package | Provide the appropriate package name |
Name | Provide the class name with first letter as capital letter |
Method Stubs | If you want to create the main method by default then just check the respective check box |
Comments | If you want to generate the default comment then select the check box. |
After the creation of the class we can see how class is created in the eclipse -