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

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:

主站蜘蛛池模板: 高唐县| 绥化市| 梧州市| 金寨县| 高雄县| 永新县| 肇庆市| 连山| 广灵县| 浦东新区| 巴东县| 深圳市| 西平县| 葫芦岛市| 射阳县| 班玛县| 呼图壁县| 工布江达县| 磴口县| 昭通市| 高州市| 溧阳市| 香格里拉县| 册亨县| 涞水县| 盐池县| 保康县| 铜鼓县| 图们市| 佛山市| 长春市| 湛江市| 巍山| 桐柏县| 东乡族自治县| 光山县| 甘孜县| 东丰县| 济宁市| 益阳市| 梅州市|