<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="serif">You can go ahead and test out the following if
you like. Create for yourself an object to hold your words
(don't worry about the internal arraylist yet -- you can add that
and any other instance variables and methods you want later).
Maybe something like...<br>
<br>
</font><tt>class WordEntry {</tt><tt><br>
</tt><tt><br>
/* Instance Variables */<br>
</tt><tt> </tt><tt>private String</tt><tt> word;</tt><tt><br>
</tt><tt><br>
/* Zero argument constructor */<br>
</tt><tt> public WordEntry ( ) { this.word = ""; }</tt><tt><br>
</tt><tt><br>
/* Constructor with a single argument - the word */<br>
</tt><tt> public WordEntry ( String word ) { this.word = word; }</tt><tt><br>
</tt><tt><br>
/* A method to return the word */<br>
</tt><tt> public String getWord(){ return word</tt><tt>; }<br>
</tt><tt><br>
</tt><tt>}</tt><font face="serif"><br>
<br>
and then try to combine it with the Parser I gave you to create an
ArrayList of ALL the words as WordEntry objects (you can even have
them multiple times in the same ArrayList). Test by printing the
WordEntries in the ArrayList (assuming you have enough memory).
Then use the Comparators we talked about in class today to try and
sort all the words alphabetically. If you can put these pieces
together you will have made significant progress on getting this
assignment done.<br>
<br>
As always, let me know where you are getting stuck.<br>
<br>
</font>
<pre class="moz-signature" cols="72">--
Andrew J. Pounds, Ph.D. (<a class="moz-txt-link-abbreviated" href="mailto:pounds_aj@mercer.edu">pounds_aj@mercer.edu</a>)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
<a class="moz-txt-link-freetext" href="http://faculty.mercer.edu/pounds_aj">http://faculty.mercer.edu/pounds_aj</a>
</pre>
</body>
</html>