O'Reilly logo

Groovy in Action by Jon Skeet, Guillaume Laforge, Paul King, Andrew Glover, Dierk Koenig

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. The simple Groovy datatypes

 

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 means for literal declaration 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 the simple datatypes; the next chapter introduces the collective datatypes.

Before we go into details, you’ll learn about Groovy’s general approach to typing. With this in mind, you can appreciate Groovy’s approach of treating everything as an object and all operators as method calls. You ...

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