Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: I/O file reading into a singly LinkedList Need Help
|
Posted: Apr 14, 2002 10:28 PM
|
|
Here is a previous answer to reading lines from a file into a List: http://www.artima.com/forums/flat.jsp?forum=1&thread=791
You are calling insertToFront(), which is not a part of List or any of its API implementations, so I guess you are using your own linked list. That means there is no way for we in this forum to know how you get elements from that list. If I were you, I'd switch to using the List interface that comes with the Java API along with an ArrayList or LinkedList. Then, printing out the list will be a simple matter of doing a System.out.println(list); or, if you want to do some more fancy stuff, getting an Iterator from the list and printing out the elements to your liking.
By the way, your AttendeesInfo class should define toString(), so that when the List tries to render each element for printing, it gets something nice to look at, not the default Object implementation of toString().
|
|