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.1.2. Core Interfaces
This section
Practice test
12 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
4 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is the main purpose of the Collection interface?
Hint
Think of the Collection interface as a foundation.
- 2.
What type of elements does a Set store?
Hint
Focus on the definition of a Set.
- 3.
What does the Collection interface represent?
- A group of elements
- A single element
- An ordered list
Hint
Think of what Collection means in programming.
- 4.
True or False: A Set allows duplicate elements.
- True
- False
Hint
Recall the distinguishing feature of a Set.
- 5.
Create a Java program that uses a List to store the names of students enrolling in a course, and demonstrate the ability to manage duplicates.
Hint
Use an if-condition to check for existing names before adding a new one.
- 6.
Implement a scenario using a Map to store a phone book, where user names are keys and phone numbers are values. Create methods to add, retrieve, and delete entries.
Hint
Remember to ensure that each user name is unique.
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
2 more questions available
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