Search This Blog

Monday, March 13

JAVA Basic Programs -- Hello World in Java



This is your first java program, simply write in any editor and save your code with finename.java and after saving program compile using javac tool and run by using java tool.








Xample: 

File_name: Helloworld.java

For Compiling: javac helloworld.java

For Execution: java Helloworld

Remember filename and class name must be the same

Xample:

class Helloworld
{
  public static void main(String[] args)
  {
    System.out.println("Hello World!");
  }
}


System.out.println("....."): are used for display message on screen or console.

Output:

Hello World!


That's it, I hope it is useful.

Thanks For reading. 

No comments:

Post a Comment