Simply write a piece of code in JAVA

Here is a simple Java program that prints "Hello, World!":

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

This program defines a class named "HelloWorld" that contains a static method named "main". At runtime, the Java Virtual Machine looks for this class and executes its "main" method. In this example, the "main" method prints "Hello, World!" by calling the "System.out.println" method.

Guess you like

Origin blog.csdn.net/yanshuai_lh/article/details/130748741