88
First Groovy Program
In the last tutorial, we have seen how to create a project and a class of groovy in eclipse. In this tutorial, we will create a simple program and learn how to run it on eclipse as well as on command prompt.
Here is the directory structure of the project.
Example 1: Demo.groovy
How to run the above program by using eclipse.
To run the above program on eclipse, right click on the screen and click on the Run As, and then on java application.
Output:
How to run the above program by using command prompt.
To run the program using command prompt, go to the folder where the program is saved.
Now, click on the address bar and type cmd and press enter key.
- Type the groovy demo.groovy in cmd, and then press enter key.
The above screen shows the output of the program in cmd.
Next TopicBasic syntax in groovy