HW 4 6/30

Due Date

  • Write a program using Collections (List, HashSet, Map).
  • Create a List to hold a collection of strings.
  • Add three IS classes (IS147, IS247, IS413) to the list.
  • Print the list collection.
  • Use the addAll method from the Collection class to add three classes (IS300, IS310, IS300).
  • Print the updated list collection.
  • Print the size of your collection.
  • Create a HashSet object.
  • Use addAll to add the List collection to the HashSet.
  • Print the HashSet.
  • Print the size of your current HashSet collection.
  • Create a HashMap object that maps strings to strings.
  • Add key-value pairs to the HashMap.
  • Create a void method called printDetail that takes Map<String, String> as an argument.
  • Use the following methods and properties from the HashMap object: size(), isEmpty(), containsKey(), remove(), get().
  • Call clear() after calling printDetail().
  • Call printDetail() again.

Expected Output

Expected Output

Due Date

How to Submit Homework?

  • Add your full name and email at the top of the file using a comment tag.
  • Compile and run your program, entering the required inputs.
  • Take a screenshot of the result.
  • Zip your project with the source code and upload it on Blackboard.
  • Upload the screenshot on Blackboard.