Created: 2022/12/26
My feeling at this moment is just someting like these emojis: 😂😎😌
Overview | |||||||||||||||||||||
Features of GroovyGroovy has the following features −
|
|||||||||||||||||||||
Environment | |||||||||||||||||||||
brew install groovy
|
|||||||||||||||||||||
Basic Syntax | |||||||||||||||||||||
Import Statement |
By default, Groovy includes the following libraries in your code, so you don’t need to explicitly import them. import java.lang.* import java.util.* import java.io.* import java.net.* import groovy.lang.* import groovy.util.* import java.math.BigInteger import java.math.BigDecimal
|
||||||||||||||||||||
Comment |
// single line comment /* multiple lines comment */
|
||||||||||||||||||||
Semicolons |
not mandatory |
||||||||||||||||||||
Identifiers |
Identifiers are used to define variables, functions or other user defined variables. Identifiers start with a letter, a dollar or an underscore. They cannot start with a number. Here are some examples of valid identifiers |
||||||||||||||||||||
Data Types | |||||||||||||||||||||
Built-in Data Types |
|
||||||||||||||||||||
Class Numeric |
java.lang.Byte
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
In addition, the following classes can be used for supporting arbitrary precision arithmetic java.math.BigInteger
java.math.BigDecimal
|
||||||||||||||||||||
Variables | |||||||||||||||||||||
Operators | |||||||||||||||||||||
Loops | |||||||||||||||||||||
Decision Making | |||||||||||||||||||||
Methods | |||||||||||||||||||||
File I/O | |||||||||||||||||||||
Optionals | |||||||||||||||||||||
Numbers | |||||||||||||||||||||
Strings | |||||||||||||||||||||
Ranges | |||||||||||||||||||||
Lists | |||||||||||||||||||||
Maps | |||||||||||||||||||||
Dates&Times | |||||||||||||||||||||
Regular Expressions | |||||||||||||||||||||
Exception Handling | |||||||||||||||||||||
Obeject Oriented | |||||||||||||||||||||
Generics | |||||||||||||||||||||
Traits | |||||||||||||||||||||
Closures | |||||||||||||||||||||
Annotations | |||||||||||||||||||||
XML | |||||||||||||||||||||
JMX | |||||||||||||||||||||
JSON | |||||||||||||||||||||
DSLS | |||||||||||||||||||||
Database | |||||||||||||||||||||
Builders | |||||||||||||||||||||
Commind Line | |||||||||||||||||||||
Unit Test | |||||||||||||||||||||
Template Engine | |||||||||||||||||||||
Meta Object Programming | |||||||||||||||||||||