Due by the end of scratch end-of -- due BY 3PM, Tuesday, February 27
I want you to complete the normalize
method
so that it uses a ListIterator
to erase any words less than three characters long
and change all words to lower case.
When complete,
you should see something like:
NOTE: you don't need to sort the list because the Set will take care of that!
null
s.
Since they could contain null
s,
the remove()
method
could not return null
as a special value.
Create a new data type class NoNullsArrayBag
that does not allow null
s.
Have it extend ArrayBag.
add(T)
throw an IllegalArgumentException if given a null
.
remove()
return null
instead of throwing a NoSuchElementException
when the Bag is empty.
(Note:
you do not need a try-catch
block to do that.)
Test your program by running TestNoNullsBag. If you've done everything correctly, you should see:
Submit this/these files: