Sunday, June 9, 2019

Groovy Interview Questions

Important Interview Question in Groovy .


  • Compare Java with Apache Groovy 


  1. Groovy is a scripting language 
  2. Less syntax
  3. default access modifier is public 
  4. automatic getters and setters
  5. does not support ARM introduced in java 7
  6. allows variable substitution inside double quotes 
  7. does not support anonymous inner class , lambda , use closure instead .
  8. 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 }

  • Explain GRAPE 
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  .





ec2-user@ec2 Permission denied