java array数组是不是类

参考oracle官网:https://docs.oracle.com/javase/tutorial/reflect/special/array.html

Arrays

An array is an object of reference type which contains a fixed number of components of the same type; the length of an array is immutable. Creating an instance of an array requires knowledge of the length and component type. Each component may be a primitive type (e.g. byteint, or double), a reference type (e.g. StringObject, or java.nio.CharBuffer), or an array. Multi-dimensional arrays are really just arrays which contain components of array type.

Arrays are implemented in the Java virtual machine. The only methods on arrays are those inherited from Object. The length of an array is not part of its type; arrays have a length field which is accessible viajava.lang.reflect.Array.getLength().

Reflection provides methods for accessing array types and array component types, creating new arrays, and retrieving and setting array component values. The following sections include examples of common operations on arrays:

All of these operations are supported via static methods in java.lang.reflect.Array.

翻译:

数组是一个引用类型的对象,它包含一个固定数量的相同类型的组件,数组的长度是不可变的。创建一个数组的实例需要了解长度和组件类型。每个部件可以是基元类型(如 byte,int或者double),引用类型(如String,object,或Java NIO CharBuffer。。),或者是一个数组。多维数组实际上是一个包含数组类型的数组的数组。


数组在虚拟机中实现。数组上唯一的方法是从对象继承。数组的长度不是类型的一部分;阵列的长度字段是可以通过Java.reflect.getlength()得到。


Reflection 提供了访问数组类型和数组组件类型、创建新数组、以及检索和设置数组组件值的方法。下面的部分包括数组的一般操作实例:
识别数组类型 描述了如何确定一个类成员是数组类型的字段
创建新的数组 说明了如何用简单和复杂的组件类型创建数组的新实例
获取和设置数组及其组件 显示了如何访问类型数组和单独访问数组元素的字段
故障排除 囊括常见的错误和编程错误
所有这些操作都是通过在静态方法java.lang.reflect.array支持。

结论:数组是一个类,他的方法是通过java.lang.reflect.array实现的。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值