Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
15.3.2. Implementations
This section
Practice test
10 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
3 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is a HashSet in Java?
Hint
Think about its fast retrieval capabilities.
- 2.
Which implementation retains insertion order?
Hint
It includes 'linked' in its name!
- 3.
Which of the following allows duplicate elements?
- HashSet
- Set interface
- TreeSet
Hint
Remember that all sets are distinct by their nature.
- 4.
True or False: LinkedHashSet also does not allow duplicates.
- True
- False
Hint
Think about what makes a Set a Set.
- 5.
Create a class that maintains a list of unique email addresses using a HashSet. Also, explain potential issues if duplicates are added.
Hint
Consider the importance of unique identifiers in email systems.
- 6.
Design an application that uses TreeSet for storing student grades, ensuring they are sorted. Discuss the trade-offs of performance.
Hint
Think about how sorting enhances the usability of grade listings.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
Get your answers marked and your progress tracked
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting