- Semicolons are optional. Use them if you like (though you must use them to put several statements on one line).
returnkeyword is optional.
- You can use the
thiskeyword inside static methods (which refers to this class).
- Methods and classes are public by default.
Protectedin Groovy has the same meaning as protected in Java, i.e. you can have friends in the same package and derived classes can also see protected members.
- Inner (non-static nested) classes are not supported at the moment. In most cases you can use closures instead, e.g. to implement interfaces. Static nested classes are supported.
throwsclause in a method signature is not checked by the Groovy compiler, because there is no difference between checked and unchecked exceptions.
- You will not get compile errors like you would in Java for using undefined members or passing arguments of the wrong type. See Runtime vs Compile time, Static vs Dynamic.