Second, the creation and execution steps of the Java project
Click File —> New —> Java Project in the upper left corner
The project naming box appears after clicking Java Project, as follows:
After the project is created, the directory structure is as follows:
Click src —> right click —> Package to create a package for storing source files
After clicking Package, a box pops up to set the package name:
After the package is created, create the source file: zpark —> right click —> New —> Class
After clicking Class, a box pops up to set the original file name, as follows:
After clicking Finish, the source file is defined, and a public class with the same name as the source file will be automatically created:
Write the code in the source file: You can use the shortcut keys in some tools:
After the source code is written, save it. If there is no syntax error, the compilation is automatically completed. The compiled .class file is saved in the bin directory of the workspace project:
Run program: class name --> right click --> Run As --> Java Application
After the program runs, the execution result is output on the console: