HelloWorld program in Java

The Hello class prints "Welcome to java" in console.

//class declaration with class keyword
public class Hello{
//main method is the starting point of execution of java class
public static void main(String[] args){
//below line prints string on the console
System.out.println("Welcome to java");

Welcome to java

Now Lets See How To write a java program&How to save and run the java program
  Step1) Open notepad  editor   And write java program:
Step2) sava file as .java extension 
Step3): Open commandprompt  and follow this step:

No comments:

Post a Comment