Finding Elements in Collections in Groovy 1. Introduction Groovy provides a substantial number of methods enhancing Java’s core capabilities. In this tutorial, we’ll show how Groovy does this when checking for an element and finding it in several types of collections. 2. Test if Element is Present First, we’ll focus… Continue Reading groovy-collections-find-elements

Integrating Groovy into Java Applications 1. Introduction In this tutorial, we’ll explore the latest techniques to integrate Groovy into a Java Application. 2. A Few Words About Groovy The Groovy programming language is a powerful, optionally-typed and dynamic language. It’s supported by the Apache Software Foundation and the Groovy community,… Continue Reading groovy-java-applications

Metaprogramming in Groovy 1. Overview Groovy is a dynamic and powerful JVM language which has numerous features like closures and traits. In this tutorial, we’ll explore the concept of Metaprogramming in Groovy. 2. What is Metaprogramming? Metaprogramming is a programming technique of writing a program to modify itself or another… Continue Reading groovy-metaprogramming

Concatenate Strings with Groovy 1. Overview In this tutorial, we’ll look at several ways to concatenate Strings using Groovy. Note that a Groovy online interpreter comes in handy here. We’ll start by defining a numOfWonder variable, which we’ll use throughout our examples: def numOfWonder = ‘seven’ 2. Concatenation Operators Quite… Continue Reading groovy-concatenate-strings

Pattern Matching in Strings in Groovy 1. Overview In this article, we’ll look at the Groovy language features for pattern matching in Strings. We’ll see how Groovy’s batteries-included approach provides us with a powerful and ergonomic syntax for our basic pattern matching needs. 2. Pattern Operator The Groovy language introduces… Continue Reading groovy-pattern-matching

Types of Strings in Groovy 1. Overview In this tutorial, we’ll take a closer look at the several types of strings in Groovy, including single-quoted, double-quoted, triple-quoted, and slashy strings. We’ll also explore Groovy’s string support for special characters, multi-line, regex, escaping, and variable interpolation. 2. Enhancing java.lang.String It’s probably good… Continue Reading groovy-strings