Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

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!