Java Programming Tutorials for Beginners, Lesson 1: Introduction to Java
So lets get started!
Step 1: Open Netbeans (This is actually the last step of Lesson 1)
|The Netbeans Window|
Step 2: Click on File and Select “New Project”. You would see the window below
Under Categories, make sure Java is selected and under Projects: make sure Java Application is selected exactly as is shown.
Step 3: Click on Next. The window below appears
Step 4: In the Project Name box, delete what is there and write: MyFirstProgram (don’t give spaces). Then you can click on Finish
If you have done everything correctly, the Java File opens where you can start writing programs. This is shown below.
Step 5: Take some time to observe the parts I labelled 1 – 6 as you can see in the screen below.
2. File Tab – Where you can see two folders. The Second folder is yours, Netbeans keeps all your file in this folder. Later, we would discuss the content.
3. Navigator Tab – Shows you the classes and functions in your program(don’t worry about these, we would discuss them later)
4. This section is where you actually write your program. So we would start writting program under the text that begins with // TODO…
5. The name of the package. This is same name as the folder name in the Files tab. The package contains all your files.
6. The name of the Function. Every java program must have this Function called main.
Now on to Step 6.
Step 6: In Section 6 under the part that says //TODO….
Type the following line of code(don’t copy and paste, type it)
System.out.println(“This is my First Program”);
As you are typing, some pop-ups may appear, ignore them and just type exactly as you see here
Step 7: Run The Program by clicking on the Run button. The Run Button is highlighted in Red. It it a green play button.