4.3. Reference Types and Values

There are four kinds of reference types: class types (§8), interface types (§9), type variables (§4.4), and array types (§10).

ReferenceType:    ClassOrInterfaceType    TypeVariable    ArrayTypeClassOrInterfaceType:    ClassType    InterfaceTypeClassType:    TypeDeclSpecifier TypeArgumentsoptInterfaceType:    TypeDeclSpecifier TypeArgumentsoptTypeDeclSpecifier:    TypeName    ClassOrInterfaceType . IdentifierTypeName:    Identifier    TypeName . IdentifierTypeVariable:    IdentifierArrayType:    Type [ ]

The sample code:

class Point { int[] metrics; }interface Move { void move(int deltax, int deltay); }

declares a class type Point, an interface type Move, and uses an array type int[] (an array of int) to declare ...

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.