Getting started with Groovy can be easy and fun! To create and run a basic script written in Groovy, follow these three steps.
// Basic Groovy Script Console console=System.console(); def name=console.readLine("What is your name? ") println "Welcome to Groovy, $name!"
Consoleobject in order to read data typed in by the user. Then the program sends a greeting that contains the name provided by the user.