Skip to content
Preview · sample content · Explore all pages

Your first Java program

Last updated: 28 Sept 20264 min read
guide
By AITrove Editorial

Connect the entry point to a visible result.

Program

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

Output

Output
Hello, AITrove!

Practice

Save as Hello.java. With a JDK installed, compile with javac Hello.java and run with java Hello. Change the message and repeat.

Common Mistakes

Check empty inputs and invalid values before applying this operation to application data. State whether a method edits shared state or returns a separate value.

java-examples
Storage details