Question: PLEASE DO THIS IN JAVA AND COMMENT CODE SO I CAN FOLLOW ALONG EASILY Just wondering how to use a HashSet Specifically in this situation.
PLEASE DO THIS IN JAVA AND COMMENT CODE SO I CAN FOLLOW ALONG EASILY
Just wondering how to use a HashSet Specifically in this situation.
- Using a HashSet, show the distinct employees that have been added to the system. Loop through each invoice and add the Employee object to a HashSet
collection. To allow this collection of Employees to not have duplicates, you will need to implement the hashcode() and equals(Object e) methods in the Employee class. After adding the employees to the HashSet, loop through the HashSet and show each employee. You may need to do a bit of research to figure this out. An employee is deemed to be the same if they have the same email address. Note that Netbeans has a good tool to generate the HashCode and equals methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
