Java - Is it possible to subclass an array? And more questions about arrays in Java

后端 未结 3 749
自闭症患者
自闭症患者 2020-12-21 04:14

These questions are purely asked out of curiosity. I don\'t actually need to subclass an array, I\'m just trying to figure out more about how they work in Java.

3条回答
  •  我在风中等你
    2020-12-21 04:27

    There is no array class in Java.

    Interestingly, arrays are objects (but not class instances):

    An object is a class instance or an array.

    More here: http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html

    The classes implementing java.util.List provide a more object-oriented implementation of array-like structures.

提交回复
热议问题