Pages

Monday, November 21, 2022

How to write Hello World in Java?|Java Tutorial for beginners

 If you are new to any language we start with Hello World which is first step of learning . 

If you have any drought or confusion there is step by step video tutorial in Hindi as well as in English  about  to start to learning Java by creating simple program of Hello World . 

Pre-condition is first download code editor , like Eclipse https://www.eclipse.org/downloads/ . which will ease your work. Also you have to download Java based on your computer system.  https://www.oracle.com/java/

Make sure you set Environmental variable . Or open command prompt by typing cmd in search bar. now type javac if you have few option as below it means you have set up correctly. there are lots of video about how to set up so you can follow that. 

Video In English 


Video In Hindi



 

open Eclipse or any code editor and click on File then Click on New


Now try to find java project if you can not find then select other project and type java and click on Java project , click on next

Enter name of Project and click on Finish


Now expand new created project and Right click on SRC, then New and Class.


Enter class name , and check mark on public static main and click on Finish. 
Since we have check mark on Public static main system will create class with main method .
Now for print in console in Java we will type system.out.println and in brace we will type hello world since it is string will use string and semicolon after code which is compulsory in  java. Make sure we will save , use control  + S . 

Now Click on Run and select First from drop down which is out class name if you have given something else make sure you select that name now check console. 

Congratulation we have our first program of Hello World.