Specifications
Sun Services
Java™ Programming Language
ix
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Wrapper Classes .................................................................................................................................... 6-41
Autoboxing of Primitive Types ........................................................................................................... 6-43
Advanced Class Features ....................................................................................... 7-1
Objectives ................................................................................................................................................. 7-2
Relevance .................................................................................................................................................. 7-3
The static Keyword ............................................................................................................................. 7-4
Class Attributes ....................................................................................................................................... 7-5
Class Methods ......................................................................................................................................... 7-7
Static Initializers .................................................................................................................................... 7-10
The final Keyword ............................................................................................................................. 7-12
Final Variables ....................................................................................................................................... 7-13
Blank Final Variables ............................................................................................................................ 7-14
Old-Style Enumerated Type Idiom .................................................................................................... 7-15
The New Enumerated Type ................................................................................................................ 7-19
Advanced Enumerated Types ............................................................................................................. 7-23
Static Imports ......................................................................................................................................... 7-25
Abstract Classes ..................................................................................................................................... 7-27
The Solution ........................................................................................................................................... 7-31
Interfaces ................................................................................................................................................ 7-34
The Flyer Example ................................................................................................................................ 7-35
Multiple Interface Example ................................................................................................................. 7-42
Uses of Interfaces .................................................................................................................................. 7-44
Exceptions and Assertions ..................................................................................... 8-1
Objectives ................................................................................................................................................. 8-2
Relevance .................................................................................................................................................. 8-3
Exceptions and Assertions ..................................................................................................................... 8-4
Exceptions ................................................................................................................................................ 8-5
Exception Example ................................................................................................................................. 8-6










