Posts

Showing posts from June, 2009

Groovy

Image
* Scripting / Agile Dynamic Language for JVM * Features inspired from Python, Ruby. * Syntax very close to Java and Same OO model as Java * Seamless integration with all existing Java classes and libraries. * Groovy code Compiles to Java bytecode. * Can run on .Net 2.0 using IKVM * Latest version 1.6 * http://groovy.codehaus.org Groovy Basic 1. Closures 2. Dynamic Methods 3. List & Maps 4. Better XML/Swing Capabilities 5. Permits operator Overloading 6. GString: interpolated String 1. Closure : => Closures are reusable blocks of code => One or more program statements enclosed in curly brackets “{}” => Closures do not require a class or a method name => Can be passed around like variables => The statements within a closure are not executed until the call() is made => Return is using an explicit return statement or the value of the last executed statement. => E.g. square = { it * it } //“it” implicit parameter representing the passed value. square (4) // Output =