Java 5 language features like enums and annotations work in Groovy also. This means we can mix Java and Groovy quite fluently. To refresh, the Java 5 language features are as follows:
Let’s discuss the extent of the Groovy support for these features.
Groovy, because of its dynamic typing, supports autoboxing from the get-go. In fact, Groovy automatically treats primitives as objects where necessary. For instance, execute the following code:
int val = 5
The type is reported as follows:
In this code, we created an instance of java.lang.Integer ...