Groovy Basics

Getting started with Groovy programming. Covers installation, IDE setup, variables, data types, operators, and fundamental syntax for beginners.

Groovy TimeCategory and Date Manipulation – Cookbook with 10+ Examples

Groovy TimeCategory and date manipulation with 13 tested examples. Write 3.days.ago, 2.hours.from.now, and natural date arithmetic using Groovy’s built-in date DSL and GDK extensions. “There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors in date arithmetic.” Joshua Bloch, Effective Java Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner-Intermediate | Reading Time: 18 minutes Our Groovy Date and Time post covers the java.time API – LocalDate, ZonedDateTime, Duration, ... Read More

Groovy Shell (groovysh) – Interactive REPL with 10 Tested Examples

The Groovy Shell (groovysh) REPL is covered here with 10 tested examples. Learn commands, tab completion, multi-line input, imports, and scripting tips on Groovy 5.x. “The best way to learn a language is to have a conversation with it. A REPL is that conversation.” Brian Kernighan, The Unix Programming Environment Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner | Reading Time: 14 minutes If you’ve installed Groovy and want a quick way to experiment ... Read More

Groovy Exception Handling – try-catch-finally with 12 Tested Examples

This guide covers Groovy exception handling with 12 tested examples. Learn try-catch-finally, custom exceptions, multi-catch, and error handling best practices on Groovy 5.x. “Exception handling is not about preventing errors. It is about deciding what happens when errors inevitably occur – and making sure your program keeps its promises.” Joshua Bloch, Effective Java Last Updated: March 2026 | Tested on: Groovy 5.x, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 18 minutes Things go wrong. Files disappear, networks ... Read More