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

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:

主站蜘蛛池模板: 巴彦县| 塔城市| 连南| 汤原县| 富锦市| 宁陵县| 金坛市| 汉源县| 太谷县| 乐清市| 准格尔旗| 远安县| 保德县| 庆元县| 额济纳旗| 通河县| 仁怀市| 神农架林区| 仪陇县| 湖口县| 都匀市| 治县。| 古浪县| 新沂市| 海口市| 五原县| 邵武市| 舒兰市| 沁阳市| 贵阳市| 察雅县| 罗江县| 会理县| 西充县| 泗水县| 浦江县| 塔河县| 建瓯市| 新建县| 河北省| 甘谷县|