I have a program that ready a file, and displays the fewuency of a length of a word, however, do to this i have used an array which specifies the max length as seen here:
this makes it so that the max word possibly read is 12....int frequency [] = new int[12];
however i need this to be whatever the maximum length of a word is?
i have the following code, this kind of works, as in it displays the lengths without me telling it hte number, however it goes all the way to 115 (with length as 0 since there are no wordsth is long.
int t = Integer.MAX_VALUE; int frequency [] = new int['t'];
How can i fix this so that it is the max length is determind?
my idea is that i might need a for loop?
sorry, im new to Java there possibly a simple answer