for(int i=0; i
S +=arr [I];
Can't find the symbols
If (I==arr. Length () - 1) {
^
Method of symbol: length ()
Location: type to int [] variable array arr just with this method will be an error with the above is ok,
CodePudding user response:
The length attribute is for Java arrays in, ask the length of the array may use its length attribute;Length () method is to the string, request the length of a string to use it the length () method;
You arr is an array, the applications you use arr. The length can be array length, arr. The length () in the arr is an array, if the arr. The length () to arr [I] length () should not be an error,
CodePudding user response:
String is the wrapper class, it is only the length () method to obtain the length,