Question: Question 1 Write a method first() that creates two priority queues, {Pineapple, Pear, Quamquat, Grape, Dragon Fruit, Boysenberries} and {Pineapple, Cantaloupe, Dragon Fruit, Blueberries, Pomegrante}
Question 1
Write a method first() that creates two priority queues, {"Pineapple", "Pear", "Quamquat", "Grape", "Dragon Fruit", "Boysenberries"} and {"Pineapple", "Cantaloupe", "Dragon Fruit", "Blueberries", "Pomegrante"}. Add to the first list a green skin fruit. Add your favorite fruit to the second list. Display their union, difference, and intersection. Note that priority queue can have duplicates. The union of two prority queues may have duplicates.
Question 2
Create a method Second(), that modifies the first(), to print the list of fruits beginning with letter b.
Question 3
Write a method third(), that creates two linked hash sets, {53, 42, 65, 91, 87, 65} and {65, 93, 42, 67, 87}. Add your birthday day, to the first list. Add a number between 12 and 40 to the second list. Display their union, difference, and intersection.
Upload java source code named your Lastname.java (ex. Samplewala.java) and the run/result, fir the above 3 sub modules.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
