First program in Java

Developing a Java Program involves


  1. writing code,
  2. compiling it into bytecode
  3. running the bytecode.

/*
   This is a simple Java program.
   Call this file "Example.java".
*/

class Example {
    public static void main(String[] args) {
        System.out.println("God is Great");
    }
}
  • Call this file "Example.java"
  • To Compile this file execute javac Example.java cmd prompt
  • To Run execute java Example