This Groovy script works fine:
println 0; class MyClass { public MyClass(int j) {}; public MyClass method() {return this}; }
This is a compilation error ("unexpected token: public on row: 5, column: 4")
println 0; class MyClass { public MyClass(int j) {}; public MyClass method() {return this}; }
The only difference is the capitalization of the class name. I know that the convention is for class names to be capitalized, but I thought it was just a convention. What exactly causes a compilation error?
source share