官术网_书友最值得收藏!

Creating a Java class

Once we have created a new project, we should see the Projects, Files, and Services tabs like I have in the following image. Let's look at the Files tab. Whereas the Projects tab is a bit of an abstraction, the Files tab shows us what's actually contained within the filesystem where our HelloWorld project lives:

 

Most importantly, you'll see that the src file here has no files in it. That's because there's no source code associated with our project, so right now it won't do anything. To remedy this, right-click on src, choose New, and then Java Class...:

We're going to name our Java Class HelloWorld, just like the name of the project because it is our main class where the program should be entered and start from. Everything else is going to work just fine here for now, so click on Finish and NetBeans will create HelloWorld.java for us. A .java file is essentially a text file, but it should only contain Java code and comments:

主站蜘蛛池模板: 金沙县| 安图县| 麻城市| 保定市| 丹凤县| 土默特右旗| 调兵山市| 若尔盖县| 长寿区| 奉贤区| 扶绥县| 赤城县| 莱州市| 阆中市| 临漳县| 蚌埠市| 康乐县| 新宾| 丹东市| 锦州市| 达拉特旗| 景德镇市| 崇仁县| 娄底市| 长宁县| 茂名市| 炎陵县| 泉州市| 徐州市| 新乐市| 宁蒗| 绥中县| 阿克陶县| 西藏| 高阳县| 灵石县| 利辛县| 辰溪县| 紫阳县| 任丘市| 南昌县|