QUIZ: What's New in J2SE 5.0

The Java 2 Platform, Standard Edition version 5.0 (J2SE 5.0) has introduced serveral enhancements as well as new language features. Test your knowledge of the J2SE 5.0, Tiger release! Choose the best answer for each question, then click Submit to see how you scored.

The codename for the J2SE 5.0 release is:

A.

Merlin

B.

Mantis

C.

Tiger

D.

Jackalope

The J2SE 5.0 release is targeted at the following major themes:

A.

Ease of development

B.

Monitoring and manageability

C.

Performance and scalability

D.

Desktop

E.

All of the above

Which of the following statement is true about J2SE 5.0?

A.

The new features and their specification APIs are defined in one JSR (JSR-176)

B.

The new features and their specification APIs are defined in multiple JSRs

C.

The new features in J2SE 5.0 are not part of any JSR or the Java Community Process

The static import feature, which is implemented as import static, enables you:

A.

To implement interfaces in order to import constants into the present namespace

B.

To import constants from interfaces and other classes without having to subclass them

C.

To use classes without importing them

D.

None of the above

Which of the following is a new keyword in J2SE 5.0?

A.

foreach

B.

in

C.

enum

D.

None of the above

One of the new features in J2SE 5.0 is the formatted output C-like statement
printf()

A.

True

B.

False

The enhanced for loop can replace the iterator when traversing through a collection of items. Which of the following statement uses the enhanced for loop?

A.

for (int e in array) { // use e }

B.

foreach (int e in array) { // use e }

C.

for (int e : array) { // use e }

D.

All of the above

Consider the J2SE 5.0 enumeration declaration
public enum Season {fall, winter, spring, summer}; what is Season?

A.

A special kind of a class that declares an enum type

B.

A special kind of an interface that declares an enum type

C.

A special kind of a get method for retrieving the enum values

One of the new classes in J2SE 5.0 that can be used for formatted input such as reading and parsing primitive type and strings is:

A.

java.io.Scanner

B.

java.util.Scanner

C.

java.io.InputReader

D.

java.util.FormattedReader

The new feature, metadata, in J2SE 5.0 is:

A.

A replacement for Javadoc comments

B.

A facility that allows developers to annotate their code so that vendors' tools could process such annotations in some fashion and generate boilerplate code (such as stubs) for technologies such as JavaBeans as Web Services