Explore tens of thousands of sets crafted by our community.
Groovy Language Features
30
Flashcards
0/30
Closures
A closure in Groovy is an anonymous chunk of code that can take arguments, return a value and be assigned to a variable.
Spread Operator
The spread operator (*) is used to apply an expression over all elements of a collection.
Grape
Grape is a dependency management and auto-downloading tool integrated in Groovy.
Groovy Console
Groovy Console is a graphical user interface application for writing and evaluating Groovy scripts.
Compile Static Annotation
@CompileStatic is an annotation that enables static compilation for annotated Groovy code, for performance close to Java's.
Meta-programming
Groovy's meta-programming capabilities allow changing the behavior of classes at runtime.
String Interpolation
Groovy provides easy syntax to embed expressions within strings using the dollar sign (
Operator Overloading
Groovy allows you to overload the standard Java operators, so you can define how operators like + or * should work with your objects.
Mixins
Mixins in Groovy allow a class to add the functionality of another class, effectively 'mixing in' methods and properties.
Groovy Shell
Groovy Shell is an interactive environment for writing and executing Groovy scripts.
Groovy Categories
Groovy categories provide a way to add methods to classes temporarily during runtime.
Lazy Evaluation
Groovy supports lazy evaluation to defer a computation until its value is needed, which can improve performance in some scenarios.
GDK (Groovy Development Kit)
A set of utility functionalities that extend the Java SDK to make it more powerful and easy to work with. These include methods added to standard Java classes.
Groovy SQL
Groovy SQL is a library that simplifies database access with a more intuitive syntax.
Native Syntax for Lists and Maps
Groovy provides a concise and developer-friendly syntax for creating and manipulating lists and maps.
Default Parameters
Methods in Groovy can define default values for parameters, simplifying method overloading.
Multiline Strings
Groovy supports strings that span multiple lines, which are declared with three double quotes or three single quotes.
Coercion and Type Conversion
Groovy performs automatic type conversion in many cases, which can be controlled or customized through coercion.
Collection Literals
Groovy has syntax for list, map and set literals, allowing for shorter and cleaner initialization.
Traits
Traits in Groovy are reusable components that can be added to classes to inherit behavior and state.
AST Transformations
AST (Abstract Syntax Tree) Transformations allow modification of the code structure before it is compiled, enabling powerful customizations.
Elvis Operator
The Elvis operator (?:) returns the not-null operand or an alternative if the first operand is null.
Groovy Markup
Groovy introduces a markup and builder syntax allowing the creation of structured data formats such as XML or HTML in a programmatic way.
Declarative Programming with Builders
Groovy's builders allow for declarative programming styles and can easily construct complex hierarchies such as UI components, JSON or XML.
Safe Navigation Operator
The safe navigation operator (?.) protects against NullPointerException by safely returning null if an intermediate property or method is null.
GStrings
GStrings are Groovy's version of String that supports interpolation.
GroovyObject
Every Groovy class implements the GroovyObject interface, which provides methods that are typically part of Groovy's dynamic nature.
Method Pointers
Method pointers in Groovy allow referencing a method as a first-class object using the `&` operator.
Dynamic Typing
Groovy is a dynamically typed language, which means variable types are checked at runtime and you do not need to specify them at compile time.
Range Operator
Groovy includes a range operator '..' to create ranges of numbers or characters.
© Hypatia.Tech. 2024 All rights reserved.