Java 5 New Language Features

Print the objectives

Take the exam   Take a beta test

This exam is mainly focused on Java SE 5 new features as described in the Sun documentation.

It contains categories for each of the main new features like Generics, Enhanced "for" loop, Autoboxing/Unboxing, Typesafe Enums, Varargs, Static Import and Metadata (Annotations).

Note to question authors: Please use "Java SE 5" in your questions (and not JDK 1.5, Java 1.5, J2SE 5,...) for consistency.

  Released  Beta  Frozen  

Generics  3 questions

The Generics Tutorial from Sun covers the basic knowledge that is necessary for this category.

  • Create code that uses Generics.
  • Describe the benefits of Generics.
  • Develop code which deals with legacy code that is not generified.

41 653 69

Enhanced "for" Loop  3 questions

  • Write code that makes appropriate use of the Enhanced for Loop.
  • Identify correct and incorrect usage of the Enhanced for Loop.
  • Explain the limitations of the Enhanced for Loop.
43 108 61

Autoboxing/Unboxing  3 questions

  • Explain what can be done with Autoboxing / Unboxing.
  • Develop code that use Autoboxing / Unboxing.
  • Discuss the appropriate use of Autoboxing / Unboxing.
  • Know that the values true, false, a byte, a char in the range \u0000 to \u007f, or an int or short number between -128 and 127, have special treatment within boxing conversions. And no assumptions can be made about other values.

Note: Before posting a question about boxing, read paragraph 5.1.7 of the Java Language Specification very carefully (especially the discussion box).

18 316 24

Typesafe Enums  3 questions

  • Identify the goals of Typesafe Enums.
  • Create enum constructors and explain how to create Enums.
  • Write code that shows the correct and incorrect usage of Typesafe Enums.
  • Use the methods in enums.
  • Work with EnumSet and EnumMap.
25 339 49

Varargs  2 questions

  • Determine the notation of Varargs.
  • Develop code using Varargs.
  • Explain why it is bad practice to overload methods with Varargs.
21 215 24

Static Import  2 questions

  • Write code that use Static Import.
  • Compare the old and new way of using static members.
  • Discuss best practices of how to use static import.
29 43 27

Metadata (Annotations)  3 questions

An introduction from IBM to Annotations is here.
The definition of Annotations can be found in chapter 9.6 & 9.7 of the Java Language Specification and in the description of the java.lang.annotation package.

  • Identify code that use Annotations.
  • Create code that use standard Annotations.
  • Develop custom Annotations.
  • Explain the advantages of Annotations.
  • Describe what marker annotations and meta-annotations are and how to use them.


Not covered: EJB 3 specific things!

40 74 57

Exam information

  • 28 minutes
  • 19 questions (2276)
  • 80% required
  • +3 √
  • - 12  points
  • 15 day delay
  • status: released

Top contributors