Groovy - Basic

Print the objectives

Take the exam   Take a beta test

This exam covers basic Groovy skills, typically encountered early by those learning Groovy.
The main objective for this exam is to ensure good knowledge of Groovy syntax, know how it differs from Java, and be able to create simple Groovy programs but not yet delving into the very dynamic nature of Groovy, which is reserved for the Groovy - Intermediate exam.

Scope
Groovy is a dynamic language that for the Java Virtual Machine. It builds upon the strengths of Java and adds powerful features inspired by the likes of Ruby, Python, and SmallTalk.
This exam focuses on all of the simple enhancements that Groovy adds to Java which anyone who uses Groovy will need to use.
For purposes of the exam, we will focus on compatibility with Groovy 1.5.6

Language
While the questions may contain Groovy snippets, they cannot contain any tricks. Java/Groovy intricacies are not covered here either, but it is assumed that the exam taker has the knowledge required to pass the Java SE - Basic exam.

Prerequisites

  • Basic Java knowledge such as:
    • Java Objects, methods, and classes
    • Java variables, types and operators
    • Java scopes and lifecycles
    • Java control structures
    • Basic Java collections knowledge (how to write and iterate over maps, for example)
    • Simple regular expressions knowledge

References Below is a list of books and web resources that will really help one study for the Groovy exams.

Not covered Please keep the level of this exam basic. What is not in the objectives below is not in the exam. For example, these topics are not covered in this exam:

  • Meta-programming
  • Groovy Builders
  • Mix-ins
  • Groovy I/O
  • Domain specific languages (DSLs)
  • GPath
  • Non-simple closures
  • Method pointers
  Released  Beta  Frozen  

Running Groovy  3 questions

  • Demonstrate knowledge of how Groovy scripts are compiled
  • Understand how to use the groovy console
  • Understand what groovysh is and how to use it
17 3 8

Fundamental Groovy  5 questions

  • Understand the Groovy lifecycle using different methods of executing Groovy (e.g. compiled Groovy vs. Groovy scripts)
  • Understand the basic syntactic differences between Java and Groovy (e.g. semicolons are not required)
  • Know that everything (including primitives) is an object in Groovy
  • Identify the differences between Java autoboxing and Groovy autoboxing (such as Groovy's boxing to BigDecimal)
60 11 8

Groovy Datatypes  5 questions

  • Know how and when to use optional typing and its advantages/disadvantages
  • Understand GStrings and produce code that uses them
  • Write Groovy code using new syntax for: ranges, lists, maps and regex
77 2 8

Groovy Control Structures  4 questions

  • Write code using Groovy truthiness
  • Understand and write code using new Groovy looping syntax (e.g. each)
Not Covered : Usage of Closures outside each loop
36 4 8

Groovy Beans  3 questions

  • Demonstrate knowledge of what a Groovy Bean is, and that this feature is always available in Groovy
  • Write and understand code using Groovy Beans
20 5 2

Exam information

  • 30 minutes
  • 20 questions (269)
  • 80% required
  • +3 √
  • - 12  points
  • 15 day delay
  • status: released

Exam leader

Top contributors