Question: Problem Description 1. [40 points] Write the following method that returns a new ArrayList. The new list contains the non-duplicate elements from the original list.

 Problem Description 1. [40 points] Write the following method that returns

Problem Description 1. [40 points] Write the following method that returns a new ArrayList. The new list contains the non-duplicate elements from the original list. public static ArrayList removeDuplicates(ArrayList list) Write a test program to create an ArrayList, and add a few objects of the same type (Integer, Double, etc) that contain duplicates, to the ArrayList. Then you use the static removeDuplicates method to return you an ArrayList that has already got the duplicates removed. 2. [60 points] Write a recursive method to return the number of uppercase letters in a string. Write a test program that prompts the user to enter a string and displays the number of uppercase letters in the string. Note that writing a non-recursive method will lead to a zero mark. Hint: you can use Character.isUpperCase() method to check whether a character is uppercase or not. The following example shows what the user will see on the screen: This program calculates the number of uppercase letters in a string. Enter a string: HelloWorld! The number of uppercase letters: 2 Notes: In the above examples, user should provide the information shown in italic. Your program should calculate and display the rest. Test your program with different inputs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!