O'Reilly logo

The Java® Language Specification, Java SE 7 Edition, Fourth Edition by Alex Buckley, Gilad Bracha, Guy Steele, Bill Joy, James Gosling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required