Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

First write a Scala class:


Compile this using scalac:

Now write our Groovy Program:


Now run the program (assuming scala-library.jar is in the CLASSPATH):

Which produces:


Note that in this example it would have been just as easy to write our Complex class using Groovy as follows:

but in other cases you may have some existing Scala classes you wish to reuse from Groovy.

  • No labels