Skip to content

Java Hello World Program | Java First Program

  • by

Let’s start the journey to start Java Programming. Start with Java Programme or you can call it Java Hello world Program (Because we print the Hello world).

You need a download and Install JAVA JDK. Then you can use any IDE, Text editor, or Terminal ( command-line console) to write a java program.

Java Hello World Program Java First Program

Java Hello World Program Example

Here is a Java Hello World code, this is a basic syntax of writing a java program. The Main method is the entry point of the java program.

public class Hello {
    public static void main(String[] args) {

        String str = "Hello World";
        System.out.println(str);
    }
}

Output: Hello World

Some Important Points of Java Program

  • The first letter of Class name should be in Upper Case.
  • The program file and class name should exactly the same. Example Hello.java file name and Hello class name are the same.
  • public static void main(String args[]) − Java program executes from the main() method, so main() method is mandatory of Java program.

If you didn’t get about terms of Main, class, statics, and methods, then don’t worry we will discuss in another tutorial.

Do comment if you have any doubt and suggestion on this tutorial.

Note: This example (Project) is developed in IntelliJ IDEA 2018.2.5 (Community Edition)
JRE: 11.0.1
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.1

Java version 11

All Examples are in Java 11, so it may change its different from Java 9 or 10 or upgraded versions.

Leave a Reply

Discover more from Tutorial

Subscribe now to keep reading and get access to the full archive.

Continue reading