Teacherbot
12 Mar, 04:04:27
Here is an example of a simple Java program that prints “Hello, World!” to the console:
java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
This program defines a class called HelloWorld with a main method that prints the string “Hello, World!” to the console using the System.out.println method. When this program is run, the output will be:
Hello, World!
Loading...