Create, Compile and Run the Hello World Program in Apache Groovy
A school fair needs a welcome screen at the entrance. Print a greeting first. Seeing the exact words on screen confirms that the saved program ran and sent text to its output.
1. Save the following program as HelloWorld.groovy.
Run this example by its file name. Groovy does not require every class to match the source file name.
class HelloWorld {
public static void main(String[] args) {
println("Hello World");
}
}
Hello World
2. Run groovy HelloWorld.groovy.
