So I'm trying to understand the flow of data of a text File inside an Array in Java.
I'm relatively new to programming, I've looked over the java docs and they're somewhat hard to familiarize myself with. Ultimately I want to find the percentage of the distribution of characters inside this txt file.
I have a method that takes in a file and returns an Array. I'm thinking I have to somehow convert the File into a string Where i can then look at the file char by char counting each instance of. From there I can calculate the distribution percentage depending on how often they each appear. But how to return that as an Array?
What I'm not sure of is whether I should use a 'File' Array, or convert the textfile into A String (toString?) put it in an Array and then try to find a way to count each instance of each char. (A-Z).
In any case, understanding how An array looks at its contents might point me in the right direction in how to tackle the problem. Any help would be greatly appreciated.