Groovy essentials for Gradle

 

Groovy Essentials:

  •         Groovy is a scripting language. So, you can write code outside of a class and execute it.
  •         Gradle configuration files are written in groovy
  •         Groovy runs on JVM
  •         It is dynamically typed hence we can use the ‘def’ keyword while initializing a variable

        Ex., def myVar = ‘Executing a script’

  •         Semi-colons at the end of a line are not required
  •        Brackets are optional while passing parameters to a function

        Ex., def multiply (int x, int y){

               println x*y

        }

        multiply 3,2  //This calls the multiply method. Notice no braces  required



 

Comments

Popular posts from this blog

Jenkins CICD in One Page

Why do we need a build tool?

Deutsche Bank Interview Questions - 2024