I need to read in a file, store the words in an arraylist and sort it in order to the number of times it appears in arraylist, starting with the most frequent. What is the easiest way to do this only using an arraylist or an iterator?
I needed to create two classes:
Word class contains a getWord, getCount, addOneToCount, and toString
WordList class uses an ArrayList of Word class (not inherit), contains an addWord method, getSize, search, sort, print, and toString.
I need help writing the sort and the print. In my main, i get a foreach error for the print.
Someone please help me!!! :(