如何在 Java 文档中找到 int[].length?
How to find int[].length on Java Documentation ?
我只是好奇!当我使用 int
table 时,我可以得到 .length
,returns 当前 table 的长度。例如:
int b[] = {0,1,2};
int l = b.length; // which is equal to 3
我想要的是获取 Java 文档中的“.length”。为了弄清楚“.length”是静态方法还是实例变量,诸如此类。
来自JLS
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.
我只是好奇!当我使用 int
table 时,我可以得到 .length
,returns 当前 table 的长度。例如:
int b[] = {0,1,2};
int l = b.length; // which is equal to 3
我想要的是获取 Java 文档中的“.length”。为了弄清楚“.length”是静态方法还是实例变量,诸如此类。
来自JLS
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.