Duration: 15:44 minutes
Summary: In this video, we will start with a PriorityQueue. We tackle an example that contains the methods add, remove, poll, offer, and peek. Using Notepad, we step through the code and wrote down the contents of the queue as we are adding and removing elements from it. Try to use this approach in the exam, so you can know the content of the queue at any point in time. You also need to know the difference between the methods listed above. Then, we look at an example that showed the difference between using a HashSet versus a TreeSet. We finally discussed a question that implemented the equals method, but then asked the difference between having the hashCode() method being implemented and not implemented.