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