Skip to main content

Blog Archive for driscoll during April 2012

Now that we've gone over some Groovy basics, it's time to switch back to writing in the Java language, and talk about how to run Groovy programs inside your Java programs.  Like most general purpose programming languages, there's more than one way to do things in Groovy, and that's never more true when it comes to executing Scripts - I once counted 7 ways to use the String "System.exit(0)" to...
In my previous post, I started with a simple Java program (which also worked in Groovy), and slowly stripped out the cruft until I was left with the following Groovy script: def sayHello(name) {    println("Hello $name!")}def name = 'world'sayHello(name) <br /> Now, let's add a little change to use an array.  Since Groovy is a rough superset of Java, you...