Array objects have the following public members:
As mentioned in the earlier section on the String class, a String uses the method length() to retrieve its length. With an array, you can use the array’s variable length to determine the number of the array’s elements. In the exam, you may be tricked by code that tries to access the length of a String using the variable length. Note the correct combination of class and member used to access its length:
I have an interesting way to remember this rule. As opposed to an array, you’ll invoke a lot of methods on String objects. So you use the method length() to retrieve the length of String and the variable length to retrieve the length of an array.
13.58.50.156