O'Reilly logo

Groovy in Action, Second Edition by Dierk König and Paul King with Guillaume Laforge, Hamlet D'Arcy, Cédric Champeau, Erik Pragt, and Jon Skeet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Simple Groovy datatypes

This chapter covers

  • Groovy’s approach to typing
  • Operators as method implementations
  • Strings, regular expressions, and numbers

Do not worry about your difficulties in mathematics. I can assure you mine are still greater.

Albert Einstein

Groovy supports a limited set of datatypes at the language level; that is, it offers constructs for literal declarations and specialized operators. This set contains the simple datatypes for strings, regular expressions, and numbers, as well as the collective datatypes for ranges, lists, and maps. This chapter covers simple datatypes; the next chapter introduces collective datatypes.

Before we go into details, we’ll talk about Groovy’s general approach to typing. With ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required