The first example in Java is to print "Hello, World!" on the screen. Let's have a quick look at the first examples in Java programming example.:


  public class MyFirstJavaProgram {

   /* This is my first java program.
    * This will print 'Hello, World!' as the output
    */

   public static void main(String []args) {
      System.out.println("Hello, World!"); // prints Hello, World!
   }
}
  
Last modified: Friday, 27 September 2024, 11:32 AM