Question: Write a class named Duplicate and include a method that removes the duplicate elements from an array list of strings using the following header: public
Write a class named Duplicate and include a method that removes the duplicate elements from an array list of strings using the following header:
public static void removeDuplicate(ArrayList
Write a test class DuplicateTest that prompts the user to enter 10 names to a list and displays the distinct names separated by exactly one comma and space sorted in descending order. Here is exact code run:
Enter name #1: John
Enter name #2: Smith
Enter name #3: Steve
Enter name #4: Hani
Enter name #5: Ali
Enter name #6: Steve
Enter name #7: Smith
Enter name #8: Steve
Enter name #9: Hani
Enter name #10: Smith
The distinct names sorted are: Steve, Smith, John, Hani, Ali
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
