Cmpt 225
Simon Fraser University
School of Computing Science
Cmpt 225 - Lab #4
Exploring The JCF
Objectives
Our objectives in this Lab #4 is to explore some of the java collections in the JCF.
Problem Statement and Specific Requirements
Write a class called JCFTest that does the following in the main method:
- Create an instance of
TreeSet
- Add 5 Integer objects to the set using the methods in the
Set interface.
- Create an iterator for the set using the iterator() method.
- Use the iterator to add the contents of the set to a new
ArrayList
As the tasks are being performed, you should print to the screen appropriate
information to illustrate that everything is working correctly.
Suggestions
This lab is intended to be short and straightforward - I just want to see you use the JCF. There is no trick... so don't put in any more time than required for a simple illustration.