6.5. Completing the Type Hierarchy

Table 6.1 summarizes the types found in Java. Only primitive data and reference values can be stored in variables. Only class and array types can be instantiated to create objects.

Table 6.1. Types and Values
TypesValues
Primitive data typesPrimitive data values
Class, interface, and array types (reference types)Reference values

Arrays are objects in Java. Array types (boolean[], Object[], StackImpl[]) implicitly augment the inheritance hierarchy. The inheritance hierarchy depicted in Figure 6.3 can be augmented by the corresponding array types. The resulting type hierarchy is shown in Figure 6.4. An array type is shown as a “class” with the [] notation appended to the name of the element type. The class SafeStackImpl ...

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.