Java acquire size: length, length (), size ()

1. java in the  length property for the array is to say, for example, declare an array you want to know the length of the array is used the length of this property.

2. java The  length() method is for the string to say, if want to see the length of the string is used in  length() this method.

3. java The  size() method is for the generic collection to say, if want to see this generic how many elements, it calls this method to see!

Guess you like

Origin www.cnblogs.com/MWCloud/p/11233676.html