From the course: Learning Groovy
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Exploring the GroovyShell and Console - Groovy Tutorial
From the course: Learning Groovy
Exploring the GroovyShell and Console
- [Instructor] We installed the Groovy runtime in the previous step. Groovy comes with two tools for executing code without having to explicitly process them with a compiler. The GroovyShell is a read-eval-print loop interpreter, also called a REPL. It is a great option for executing single-line Groovy statements. You can open the GroovyShell with the help of the command groovysh. You will see a prompt. We'll execute the Groovy statement, println "Hello World." Println renders a string on the console. After pressing the enter key, you should see the result of the execution, the message Hello World. Furthermore, you will also see the return value of the expression. The println statement does not return a value, and therefore, the output renders null. Let's exit the Shell for now by pressing the keys CTRL + C. Another tool I'd like to show you is the so-called Groovy Console. You can open the console by…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.