Friday, June 16, 2017

Arrays are objects in Java

In the Java programming language, arrays are objects, are dynamically created, and may be assigned to variables of type Object. All methods of class Object may be invoked on an array.

Every array has an associated Class object, shared with all other arrays with the same component type. [This] acts as if: the direct superclass of an array type is Object [and] every array type implements the interfaces Cloneable and java.io.Serializable.

@reference_1_zhihu.com
JAVA中的数组是对象吗?

No comments:

Post a Comment