These exercises demonstrate properties of some common collections.
- Download the starter code from Github Classroom.
- Do the exercises.
- Write your findings in README.md
- Push the completed code to Github.
See Collections-practice in week4 folder of class web.
Answer the questions in the exercises here. Push your answer and code to Github Classroom.
-
When you print elements in the set, are they in same order as you added them?
-
what is the command to remove all elements from a
set
? -
When you add elements in a different order and print them, did the order change?
-
Can you add a duplicate "cat" and "dog" to set?
-
What is the result when you use TreeSet instead of HashSet?
-
Could we make
setExplorer
work with either Set or List? How?