Java coders get Groovy language

Maartje van Caspel

Java programmers who want the flexibility of new languages such as Ruby now can have the best of both worlds, with an emerging language called Groovy, according to a presentation given last week at the Northern Virginia Java Users Group.

Groovy closely resembles Java yet also has the dynamic nature of scripting languages such as Ruby or Python, said Michael Aube, a senior presales engineer at CA Wily Technology, who made the presentation.

Groovy uses the same object and runtime model as Java and handles class, inheritance, field and method definitions the same way. This allows Groovy programmers to use all Java application program interfaces within their own code.

Because Groovy so closely resembles Java, Java programmers can get up to speed on Groovy quickly. Like many scripting languages ' and unlike Java itself ' Groovy allows for dynamic typing, or the freedom not to assign specific data types to variables before the code is run.

As a result, the language is good for trying out new ideas quickly, Aube said. 'It's ideal for rapid prototyping,' he said. 'You can run Groovy commands directly from a command-line shell or run Groovy scripts within a Groovy console.'

'When you run a Groovy script, it is compiled down to the Java bytecode and'runs inside' the Java Virtual Machine, Aube added.

About the Author

Joab Jackson is the senior technology editor for Government Computer News.

Reader Comments

Please post your comments here. Comments are moderated, so they may not appear immediately after submitting. We will not post comments that we consider abusive or off-topic.

Please type the letters/numbers you see above