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

10.7. Array Members

The members of an array type are all of the following:

• The public final field length, which contains the number of components of the array. length may be positive or zero.

• The public method clone, which overrides the method of the same name in class Object and throws no checked exceptions. The return type of the clone method of an array type T[] is T[].

A clone of a multidimensional array is shallow, which is to say that it creates only a single new array. Subarrays are shared.

• All the members inherited from class Object; the only method of Object that is not inherited is its clone method.

An array thus has the same public fields and methods as the following class:

class A<T> implements Cloneable, java.io.Serializable ...

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