Due by the end of today by midnight
printListForEach
using a for-each loop.
Note:
the output should look just like the output
from the printListWithIterator method.
That is:
You might want to see how that method goes about making sure that there are four words per line and each word right-justified in its column.
takeFive
that takes a List of any type
and returns a List of the same type
consisting of the first five elements of the given List.
Those five items are removed from the given List.
Test your method using the following code:
You should get the following output:
What should happen if the given list doesn't have five elements? Modify your method so that it does a reasonable thing (unless it already does an appropriate thing, in which case, never mind).
Submit this/these files: