Monday, April 11, 2011

Groovy script v class

Apparently, a groovy file is either a script or a class file, not both (contrary to this example). If you try to do something like:
class Foo {
def bar
}

def baz = new Foo()

you'll get an error like:
Invalid duplicate class definition of class Foo


Further explanation here and here.

No comments:

Post a Comment