I am new to Java and I could not understand this structure:
public static int[] upperCounter(String str) {
final int NUMCHARS = 26;
int[] upperCounts = new int[NUMCHARS];
char c;
for (int i = 0; i < str.length(); i++) {
c = str.charAt(i);
if (c >= 'A' && c <= 'Z')
upperCounts[c-'A']++;
}
return upperCounts;
}
This method works, but what does it mean list[c-'A']++;?
source
share