Skip to main content

Featured

Daisy Ft Rocky Bhai KGF Edit 4K @Shadow Edits @Monster Universe

via IFTTT

Simple Hello World Program

 Create Your first Hello World Program in Java

Did you just follow our tutorial on how to start programming in your old Low-End PC?

And you don't know what to do next?
Here is the tutorial on how to create your first program. A Hello World program.


let's get started :-

1. Open Eclipse, Choose Your Workspace and Click Launch.
2. Create a new Java Project 
3. Choose your Program name for me it will be "Simple Paint" and untick create module-info.java file. Click on Finish

4. On the life side click on your project name. Right click on src folder which stands for source. Click on new - new Package

5. Choose your package name. Packages name are like :
" com.yourDomain " or " com.companyname" or "me.yourname"

6.  After creating your package. Right click on it Choose New - new Class.



7. Name Your Class something like "Main" because it will the main class for our Program and check the main method box.


8. After your Class is created check if you have main method. If you don't have it just copy and paste this. Don't worry we will discuss what is main method later. for now just know that everything inside main method will run as soon as you start the program.


"

public static void main(String[] args) {

}


"



9. Now you can write " System.out.println("Hello World"); " to make your first hello world program.

here, System is a class. Out is a nested class inside System, And println() is method that is used to print things to console. you can write ("_") in the blank space and everything will be printed to console.


10. Now you can click on the Run as tool that will run your program and you will see Hello world printed to bottom console









Congrats You just created your first Java program!


Don't forget to comment your thoughts.

        If you have any question you can ask in the comments.





Comments

Popular Posts