In a project i'm working on I have to take a census .txt file containing names and put it into a "NameRank" (which holds the name, and information about the national ranking of the name) after I put the file into an Array of NameRanks. The next part I have to create 5 data structures - ArrayList, HashSet, LinkedList, TreeSet, and Vector and put the info. from the NameRank Array into each and bench mark the time it takes to complete the whole process. I wrote my code and it all works except when I try to add something to the TreeSet that i have created using:
when it gets to adding the file from the array I get this error:
The line that it is generating this exception is in this loop:
For every other data structure it works when this is commented out.