Question: Write a program in Java to store a collection of movie names. There should be no duplicate movies in the collection. The program must be

  1. Write a program in Java to store a collection of movie names. There should be no duplicate movies in the collection. The program must be able to (20 mark):
  • add a movie
  • remove a movie
  • check if a movie exists
  • delete all movies
  • print out the number of movies
  • print a list of all movie names

use HashSet

  1. Write a program in java that implements a HashMap to store students (student IDs as the key, and student names as the value). The program must be able to (10 mark):
  • add some students, then print all students’ name
  • remove all of the students at once

Step by Step Solution

3.31 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

HashSetExjava import javaio import javautil public class HashSetEx public static Set s1 new HashSet ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!