My code below is supposed to read text from a file and store it into a string,
then count the frequency of each letter and store it into an array counters. When
compiling i receive the arrayindexoutofbounds error for line 42 of my code which is the
line: scanner2.close() .
Also confused on what the \\A string pattern does on the use.delimiter() as a partner helped
with this and forgot to add comments. thank you
Also, are you sure every single character in your input will be a letter of the alphabet? Your formula for the array index subtracts 'A' from each character and if that character is not one from 'A' to 'Z' then you'll get a number that is out of range of your valid array indices.
For example, if your input contains any punctuation, then those will produce an invalid index.