Remember Java chars are numeric - ordinary characters correspond to integer values under 128. If you have an array of 127 ints you can use a char as the index to access an element of the array and increment it...
JamesCherrill
Posting Genius
6,372 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Yes, you only need one array.
Yes, the numeric value of the char the decimal for it in the ascii table.
Not exactly ... Java uses 16 bit UniCode to store characters, and these are only the same as ASCII for codes up to 127. ASCII extended characters are basically irrelevant in Java as UniCode handles all such symbols far better.
Having said all that, you don't really need to know the decimal equivalents, just use chars and they will work as both letters and numeric values as if by magic, eg
for (char c = 'a'; c <= 'z'; c++) System.out.print(c);
or
array['a']++;
JamesCherrill
Posting Genius
6,372 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073