Important Interview Question in Groovy .
- Compare Java with Apache Groovy
- Groovy is a scripting language
- Less syntax
- default access modifier is public
- automatic getters and setters
- does not support ARM introduced in java 7
- allows variable substitution inside double quotes
- does not support anonymous inner class , lambda , use closure instead .
- groovy supports operator overloading
- What is AST transformations.
the ability to customize the Abstract Syntax Tree representing your programs before the compiler walks this tree to generate Java bytecode .
- Explain closure in groovy
A closure in Groovy is an open, anonymous, block of code that can take arguments, return a value and be assigned to a variable
{ [closureParameters -> ] statements }
Grape stands for the Groovy Adaptable (Advanced) Packaging Engine
Grape helps you download and cache external dependencies from within your script with a set of simple annotations.
@Grab('org.apache.httpcomponents:httpclient:4.2.1')
- What is the use of @GrabResolver
By default GRAPE uses Maven Central Repository , if we need to add our own repository we can use @GrabResolver .