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

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:

主站蜘蛛池模板: 龙口市| 阳西县| 淳安县| 塘沽区| 望城县| 都江堰市| 九台市| 泾源县| 阳高县| 虎林市| 财经| 竹溪县| 临猗县| 慈利县| 奉新县| 奉节县| 高邑县| 汕尾市| 女性| 新野县| 淳化县| 朝阳市| 赣州市| 平顺县| 乌拉特中旗| 麻栗坡县| 乌鲁木齐市| 孟连| 南靖县| 苏尼特右旗| 台安县| 新沂市| 鲜城| 布拖县| 广安市| 电白县| 常州市| 澄城县| 加查县| 磐石市| 天全县|