Hello. I am quite new to
java. I have taken one class, and have done some reading, but am still putting things together.
Listed below is a small bit of code which creates an integer array, then finds and displays the length of the array. I am trying to find out more about the "intArray.length" construct. I understand that an array is an object. How do I look for the array object in the Java API? What I did find is an Array class in the java.lang.reflect package, which extends the Object class, if I am understanding it right. When I look for instance variables in the Array class, I do not find one. Under the methods, there was "getLength", but not length. Also, it was my general understanding that a method always ends with parenthesis.
public class testing2 {
public static void main (
String[] args) {
int[] intArray = {1,2,3};
int intArrayLength = intArray.length;
System.out.println("length of intArray is " + intArrayLength);
}
}