- Offers seamless integration with Java
- Java like syntax with flat learning curve
- Mix and match Groovy and Java classes
- Brings in Dynamic language features to Java
- Brings in Fun with Productivity
Groovy generates same bytecode as Java. Once compiled, Groovy classes are nothing but Java classes for the JVM.
Groovy has Java like systax. Groovy code is more concise and readable than Java code. It comes with dynamic language features that Java language is lacking. Also brings in scripting capabilities.
A Groovy class can extend a Java class and vice versa. A Java class can implement a Groovy interface and vice versa. Groovy shares same object model, libraries ans same security model as Java.
JetBrains "joint compiler" eliminates the need for cleverly chosing the order of compilation while mixing groovy and java classes when one extending another or one implementing another and vice versa. It offers compilation of both classes with one go without having to worry about dependencies between both types of classes.
When compiling from command line through groovyc, just specify -j for joint compilation. For e.g.
groovyc *.groovy *.java -j -Jsource=1.4 -Jtarget=1.4
ANT task and Maven plugin is available for groovy project. Maven archetype is also available for rapid bootstraping your project.Run-time method dispatch is one of the core feature of a dynamic language. It happens at run-time instead of compile-time.
Groovy is fun and lot more productive to code than Java. Your code can be more precise, expressive and readable than Java code.