3

I am just curious ! When I use an int table, I can get to .length, which returns the length of the current table. For exemple :

int b[] = {0,1,2};
int l = b.length; // which is equal to 3

What I want is to get to ".length" in the Java documentation. In order, to figure out if ".length" is a static method or instance variable , and things like that.

1 Answers1

1

From the 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.
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331