Appendix A. Get Started with Groovy

Groovy is an object-oriented, dynamically typed scripting language for Java developers. Java developers should feel comfortable using Groovy because it perpetuates Java’s syntax and semantics. Groovy also provides a more succinct syntax that results in code much smaller than comparable Java code. A developer can mix Java and Groovy style syntax, which allows Java developers to ease themselves into using Groovy style syntax. This chapter introduces you to the Groovy syntax to facilitate your understanding of Groovy code snippets throughout the text of this book.

Before we dive into syntax, let’s start with a simple Java class that prints a message to stdout (standard out) and then rewrites it in a Groovy way ...

Get Getting Started with IBM WebSphere sMash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.