SlideShare a Scribd company logo
1 of 13
Groovy Basics
 Groovy is an object-oriented programming
language for the Java platform. It is a dynamic
language with features similar to those of
Python, Ruby, Perl.
 Groovy is a powerful, optionally typed and
dynamic language, with static-typing and static
compilation capabilities, for the Java platform
aimed at multiplying developers’ productivity
thanks to a concise, familiar and easy to learn
syntax.
 Groovy 2.4
 Groovy 2.4 is the latest version of Groovy.
Important: Releases before 2.4.4 weren't done
under the Apache Software Foundation.
 Groovy 2.4 requires Java 6+ with full support up
to Java 8.There are currently some known issues
for some aspects when using Java 9 snapshots.
The groovy-nio module requires Java 7+. Using
Groovy’s invokeDynamic features require Java
7+ but we recommend Java 8.
 class Example {
 static void main(String[] args) {
 // Using a simple println statement to print
output to the console
 println('HelloWorld');
 }
 }
 In Groovy, everything is an object. Objects
have methods and properties.
 Methods are the things the object can do, and similar
to other languages, are optionally (more on that later)
invoked with parentheses () that may contain
arguments.
 // calling method doSomething on someObject
someObject.doSomething() // calling method
doSomethingElse with one argument
someObject.doSomethingElse("a string argument") //
get the property named someProperty on someObject
someObject.someProperty
 Strings can be defined using single, double, or
triple quotes:
 def a = "some string"
 def b = 'another string'
 dev c = '''Triple quotes allow multiple lines''‘
Strings defined with double quotes support
interpolation.This allows us to substitute any
Groovy expression into a String at the specified
location. Interpolation is achieved using
the ${} syntax:
 // simple list of Numbers
 def myList = [2, 3, 5, 8, 13, 21]
 // use the << operator to append items to a list
myList << 34
 assert myList == [2, 3, 5, 8, 13, 21, 34]
 // get elements in a list
 // first element is at index 0
 assert 8 == myList[3]
 // can use negative index to start from the end
assert 21 == myList[-2]
 // lists can support different types of data
 def myMixedList = [1, "two", true]
 // simple map of key/value pairs def myMap =
[key1: "value1", key2: "value2"]
 // can get value for a key with the "." notation:
assert "value1" == myMap.key1
 // can also get the value using subscript
notation: assert "value2" == myMap['key2']
 // a list of maps
 def listOfMaps = [[key1: "val1", key2: "val2"],
[key1: "another val", key2: "and another"]]
assert "another val" == listOfMaps[1].key1
 What are AST transformations?
 An Abstract SyntaxTree (AST) is a in memory
representation of code as data.An ADT
transformation allows to modify this
representation during compile time.
 This is sometimes called compile-time meta
programming.
 Groovy provides severalAST transformations
which allows you to reduce the amount of
code you have to write
 What is the Meta Object Protocol_
 The Meta-Object Protocol (MOP) is the
underlying layer in Groovy which allows you
to add methods and properties to an object
at runtime. Using MOP you can methods and
properties at runtime to existing objects.

 Groovy is based on Java regular expression
support and add the addition support
operators to make the usage of regular
expressions easier.
 Groovy adds the Slashy string as String
declaration. Slashy strings are Strings
between two "/" signs.They don't need
escape backslashes in regular expressions.
 Simplification - Groovy does not require semicolons at the end of
statements.
 The return keyword can be left out, by default Groovy returns the last
expression of the method, top level parentheses can be left out,
the public keyword can be left out, it is the default in Groovy. It also
allows optional typing.
 Flexibility - Groovy allows to change classes and methods at runtime, e.g.
if a method is called which does not exist on a class, the class can
intercept this call and react to it.
 This allows for example that Groovy provides a very flexible builder
pattern.
 Ease of use - Groovy has list, maps and regular expressions directly build
into the language.
 Simplification in I/O - parsing and creating XML, JSON and files is very
simple with Groovy.
 Groovy automatically imports the following
packages and classes which can be used in
Groovy without specifying the package name.
 groovy.lang.*
 groovy.util.*
 java.lang.*
 java.util.*
 java.net.*
 java.io.*
 java.math.BigInteger
 java.math.BigDecimal

More Related Content

What's hot

Features of java - javatportal
Features of java - javatportalFeatures of java - javatportal
Features of java - javatportalJavaTportal
 
Java Introduction
Java IntroductionJava Introduction
Java Introductionjaveed_mhd
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSaba Ameer
 
Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming Saravanakumar R
 
JAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKASJAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKASNAVEEN TOKAS
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for DesignersR. Sosa
 
Java Basics
Java BasicsJava Basics
Java BasicsKhan625
 
Learn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat ShahriyarLearn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat ShahriyarAbir Mohammad
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
Java programming language
Java programming languageJava programming language
Java programming languageSubhashKumar329
 

What's hot (20)

Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Features of java - javatportal
Features of java - javatportalFeatures of java - javatportal
Features of java - javatportal
 
Java. converted (2)
Java. converted (2)Java. converted (2)
Java. converted (2)
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java
JavaJava
Java
 
History of java'
History of java'History of java'
History of java'
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming
 
JAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKASJAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKAS
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Features of java
Features of javaFeatures of java
Features of java
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Learn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat ShahriyarLearn Java with Dr. Rifat Shahriyar
Learn Java with Dr. Rifat Shahriyar
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
Java programming language
Java programming languageJava programming language
Java programming language
 

Viewers also liked

Workforce Magazine - August 2015
Workforce Magazine - August 2015Workforce Magazine - August 2015
Workforce Magazine - August 2015Dylan Choong
 
Listino prezzi BMW Serie 3 Gran Turismo
Listino prezzi BMW Serie 3 Gran Turismo Listino prezzi BMW Serie 3 Gran Turismo
Listino prezzi BMW Serie 3 Gran Turismo autoblogpuntoit
 
ACI Mercato auto usate novembre 2012
ACI Mercato auto usate novembre 2012ACI Mercato auto usate novembre 2012
ACI Mercato auto usate novembre 2012autoblogpuntoit
 
Listino Prezzi McLaren 570GT
Listino Prezzi McLaren 570GTListino Prezzi McLaren 570GT
Listino Prezzi McLaren 570GTAutoblog.it
 
Luis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín- 'Horal', sus orillas extremasLuis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín- 'Horal', sus orillas extremasLuis Alberto Marín Aguilar
 
STOCK_ANALYSIS_PROJECT
STOCK_ANALYSIS_PROJECTSTOCK_ANALYSIS_PROJECT
STOCK_ANALYSIS_PROJECTLouise Miller
 
Agentschap Integratie en Inburgering heeft geschil met provincies
Agentschap Integratie en Inburgering heeft geschil met provinciesAgentschap Integratie en Inburgering heeft geschil met provincies
Agentschap Integratie en Inburgering heeft geschil met provinciesThierry Debels
 
Listino Prezzi Lancia Ypsilon
Listino Prezzi Lancia YpsilonListino Prezzi Lancia Ypsilon
Listino Prezzi Lancia Ypsilonautoblogpuntoit
 
Fiat-Chrysler 3,3% VEBA
Fiat-Chrysler 3,3% VEBAFiat-Chrysler 3,3% VEBA
Fiat-Chrysler 3,3% VEBAAutoblog.it
 
Bollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Bollo auto più caro con carta di credito: 3 milioni di multa all'AciBollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Bollo auto più caro con carta di credito: 3 milioni di multa all'AciAutoblog.it
 
1 introduction-to-computer-networking
1 introduction-to-computer-networking1 introduction-to-computer-networking
1 introduction-to-computer-networkingPriya Manik
 
group 3
group 3group 3
group 3kilaye
 
Catálogo de plantas para espacios abiertos.
Catálogo de plantas para espacios abiertos.Catálogo de plantas para espacios abiertos.
Catálogo de plantas para espacios abiertos.Charlsarq
 
はじめての UWP アプリ開発
はじめての UWP アプリ開発はじめての UWP アプリ開発
はじめての UWP アプリ開発hiyohiyo
 

Viewers also liked (20)

Workforce Magazine - August 2015
Workforce Magazine - August 2015Workforce Magazine - August 2015
Workforce Magazine - August 2015
 
Python component in mule
Python component in mulePython component in mule
Python component in mule
 
Tema 2 RRPP
Tema 2 RRPPTema 2 RRPP
Tema 2 RRPP
 
Listino prezzi BMW Serie 3 Gran Turismo
Listino prezzi BMW Serie 3 Gran Turismo Listino prezzi BMW Serie 3 Gran Turismo
Listino prezzi BMW Serie 3 Gran Turismo
 
Angular js
Angular jsAngular js
Angular js
 
ACI Mercato auto usate novembre 2012
ACI Mercato auto usate novembre 2012ACI Mercato auto usate novembre 2012
ACI Mercato auto usate novembre 2012
 
Listino Prezzi McLaren 570GT
Listino Prezzi McLaren 570GTListino Prezzi McLaren 570GT
Listino Prezzi McLaren 570GT
 
Luis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín- 'Horal', sus orillas extremasLuis Alberto Marín- 'Horal', sus orillas extremas
Luis Alberto Marín- 'Horal', sus orillas extremas
 
STOCK_ANALYSIS_PROJECT
STOCK_ANALYSIS_PROJECTSTOCK_ANALYSIS_PROJECT
STOCK_ANALYSIS_PROJECT
 
Agentschap Integratie en Inburgering heeft geschil met provincies
Agentschap Integratie en Inburgering heeft geschil met provinciesAgentschap Integratie en Inburgering heeft geschil met provincies
Agentschap Integratie en Inburgering heeft geschil met provincies
 
Listino Prezzi Lancia Ypsilon
Listino Prezzi Lancia YpsilonListino Prezzi Lancia Ypsilon
Listino Prezzi Lancia Ypsilon
 
Fiat-Chrysler 3,3% VEBA
Fiat-Chrysler 3,3% VEBAFiat-Chrysler 3,3% VEBA
Fiat-Chrysler 3,3% VEBA
 
Pembaharuan sumber tenaga
Pembaharuan sumber tenagaPembaharuan sumber tenaga
Pembaharuan sumber tenaga
 
IPC
IPCIPC
IPC
 
Bollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Bollo auto più caro con carta di credito: 3 milioni di multa all'AciBollo auto più caro con carta di credito: 3 milioni di multa all'Aci
Bollo auto più caro con carta di credito: 3 milioni di multa all'Aci
 
1 introduction-to-computer-networking
1 introduction-to-computer-networking1 introduction-to-computer-networking
1 introduction-to-computer-networking
 
group 3
group 3group 3
group 3
 
Catálogo de plantas para espacios abiertos.
Catálogo de plantas para espacios abiertos.Catálogo de plantas para espacios abiertos.
Catálogo de plantas para espacios abiertos.
 
Reportes
ReportesReportes
Reportes
 
はじめての UWP アプリ開発
はじめての UWP アプリ開発はじめての UWP アプリ開発
はじめての UWP アプリ開発
 

Similar to Groovy features

Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyAndres Almiray
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java DevelopersAndres Almiray
 
An Introduction to Groovy for Java Developers
An Introduction to Groovy for Java DevelopersAn Introduction to Groovy for Java Developers
An Introduction to Groovy for Java DevelopersKostas Saidis
 
eXo EC - Groovy Programming Language
eXo EC - Groovy Programming LanguageeXo EC - Groovy Programming Language
eXo EC - Groovy Programming LanguageHoat Le
 
Introduction to Oracle Groovy
Introduction to Oracle GroovyIntroduction to Oracle Groovy
Introduction to Oracle GroovyDeepak Bhagat
 
Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3Vijay Shukla
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemKostas Saidis
 
Introduction To Groovy
Introduction To GroovyIntroduction To Groovy
Introduction To Groovymanishkp84
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Wsloffenauer
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming LanguageYLTO
 
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxINDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxIndu65
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersKostas Saidis
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingFeelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingMatt Stine
 

Similar to Groovy features (20)

Eclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To GroovyEclipsecon08 Introduction To Groovy
Eclipsecon08 Introduction To Groovy
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
 
An Introduction to Groovy for Java Developers
An Introduction to Groovy for Java DevelopersAn Introduction to Groovy for Java Developers
An Introduction to Groovy for Java Developers
 
Groovy intro
Groovy introGroovy intro
Groovy intro
 
eXo EC - Groovy Programming Language
eXo EC - Groovy Programming LanguageeXo EC - Groovy Programming Language
eXo EC - Groovy Programming Language
 
Introduction to Oracle Groovy
Introduction to Oracle GroovyIntroduction to Oracle Groovy
Introduction to Oracle Groovy
 
Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3
 
Apache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystemApache Groovy: the language and the ecosystem
Apache Groovy: the language and the ecosystem
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
Introduction To Groovy
Introduction To GroovyIntroduction To Groovy
Introduction To Groovy
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 
2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws2007 09 10 Fzi Training Groovy Grails V Ws
2007 09 10 Fzi Training Groovy Grails V Ws
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming Language
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxINDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingFeelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
 

More from Ramakrishna kapa

More from Ramakrishna kapa (20)

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Batch processing
Batch processingBatch processing
Batch processing
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
 

Recently uploaded

Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 

Recently uploaded (20)

Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

Groovy features

  • 2.  Groovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of Python, Ruby, Perl.  Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax.
  • 3.  Groovy 2.4  Groovy 2.4 is the latest version of Groovy. Important: Releases before 2.4.4 weren't done under the Apache Software Foundation.  Groovy 2.4 requires Java 6+ with full support up to Java 8.There are currently some known issues for some aspects when using Java 9 snapshots. The groovy-nio module requires Java 7+. Using Groovy’s invokeDynamic features require Java 7+ but we recommend Java 8.
  • 4.  class Example {  static void main(String[] args) {  // Using a simple println statement to print output to the console  println('HelloWorld');  }  }
  • 5.  In Groovy, everything is an object. Objects have methods and properties.  Methods are the things the object can do, and similar to other languages, are optionally (more on that later) invoked with parentheses () that may contain arguments.  // calling method doSomething on someObject someObject.doSomething() // calling method doSomethingElse with one argument someObject.doSomethingElse("a string argument") // get the property named someProperty on someObject someObject.someProperty
  • 6.  Strings can be defined using single, double, or triple quotes:  def a = "some string"  def b = 'another string'  dev c = '''Triple quotes allow multiple lines''‘ Strings defined with double quotes support interpolation.This allows us to substitute any Groovy expression into a String at the specified location. Interpolation is achieved using the ${} syntax:
  • 7.  // simple list of Numbers  def myList = [2, 3, 5, 8, 13, 21]  // use the << operator to append items to a list myList << 34  assert myList == [2, 3, 5, 8, 13, 21, 34]  // get elements in a list  // first element is at index 0  assert 8 == myList[3]  // can use negative index to start from the end assert 21 == myList[-2]  // lists can support different types of data  def myMixedList = [1, "two", true]
  • 8.  // simple map of key/value pairs def myMap = [key1: "value1", key2: "value2"]  // can get value for a key with the "." notation: assert "value1" == myMap.key1  // can also get the value using subscript notation: assert "value2" == myMap['key2']  // a list of maps  def listOfMaps = [[key1: "val1", key2: "val2"], [key1: "another val", key2: "and another"]] assert "another val" == listOfMaps[1].key1
  • 9.  What are AST transformations?  An Abstract SyntaxTree (AST) is a in memory representation of code as data.An ADT transformation allows to modify this representation during compile time.  This is sometimes called compile-time meta programming.  Groovy provides severalAST transformations which allows you to reduce the amount of code you have to write
  • 10.  What is the Meta Object Protocol_  The Meta-Object Protocol (MOP) is the underlying layer in Groovy which allows you to add methods and properties to an object at runtime. Using MOP you can methods and properties at runtime to existing objects. 
  • 11.  Groovy is based on Java regular expression support and add the addition support operators to make the usage of regular expressions easier.  Groovy adds the Slashy string as String declaration. Slashy strings are Strings between two "/" signs.They don't need escape backslashes in regular expressions.
  • 12.  Simplification - Groovy does not require semicolons at the end of statements.  The return keyword can be left out, by default Groovy returns the last expression of the method, top level parentheses can be left out, the public keyword can be left out, it is the default in Groovy. It also allows optional typing.  Flexibility - Groovy allows to change classes and methods at runtime, e.g. if a method is called which does not exist on a class, the class can intercept this call and react to it.  This allows for example that Groovy provides a very flexible builder pattern.  Ease of use - Groovy has list, maps and regular expressions directly build into the language.  Simplification in I/O - parsing and creating XML, JSON and files is very simple with Groovy.
  • 13.  Groovy automatically imports the following packages and classes which can be used in Groovy without specifying the package name.  groovy.lang.*  groovy.util.*  java.lang.*  java.util.*  java.net.*  java.io.*  java.math.BigInteger  java.math.BigDecimal