New Features of Java Required for the AP™ Exam

Generic Collections

The Advanced Placement test now requires an understanding of certain new features available in Java 5.0.  From the AP perspective, the most important new feature in Java 5.0 is the generic collection.  A generic collection requires the programmer to specify the collection's element type.  AP A level students must know how to use the generic array list collection.  More ...
 
The AP AB level students must also know how to use the generic versions of lists, sets, maps, stacks, queues, priority queues, and iterators.  The material in Chapters 13 through 19, which covers the AP AB requirements in depth, has been thoroughly revised to adhere to the new standard.  We also show how to define new classes that implement generic collections, such as stacks, queues, binary search trees, and heaps.   More . . .

Enhanced for Loop

AP A level students must also know how to use an enhanced for loop with arrays and array lists.  AP AB level students must also know how to use an enhanced for loop with linked lists and sets.  The material on arrays, lists, sets, and for loops has been updated to reflect these changes in requirements. More . . .

Useful but Not Required New Features

Autoboxing and Unboxing

Java collections require that elements of primitive types such as integers and doubles be wrapped in objects.  However, Java 5.0 automatically wraps these values during insertions and unwraps them during accesses.  Autoboxing and unboxing make it much easier for the programmer to work with collections of numbers.  More . . .

Enhanced Terminal Input

As in previous years, the AP test requires simple standard terminal output but no input. A realistic first course will need some form of input, if only from the keyboard. Java 5.0 includes a delightful new Scanner class for text input from the keyboard and from files. The new edition of the book now uses these new features instead of an open source toolkit for text I/O. More . . .

Formatted Output

Java 5.0 includes support for the easy formatting of text for output. The new edition uses the methods String.format and printf instead of an open source toolkit for formatted output.  More . . .

Other Major Changes

Graphics and GUIs

In response to the suggestions of some instructors, we have moved the material on graphics and GUIs, which is not required for the AP test, to end-of-chapter sections.  The introduction of this extra material is gradual enough that we have been able to dispense with the use of an open source toolkit and rely on the standard Java toolkits in the new edition.  Instructors are now free to view graphics and GUIs as extra material to challenge students, and will not have to install or teach non-standard toolkits to accomplish this. More . . .