Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
//Callee.groovy
class Callee {
  void hello() {
     println "hello, world"
  }
}

 

Code Block
//Caller.groovy
c = new Callee()
c.hello()

 

Code Block
groovy -cp . caller

...

This will execute the autogenerated main(String[] args) method in the bytecode which instantiates the Foo class, which extends the 

link
Script
Script
1http://groovy.codehaus.org/apidocs/groovy/lang/Script.html
class and then call its run() method. You may also use this class directly in Java code, passing in variables to the script.

...