Question: Write a static method public static char[] filter(char[] list, char target) The method will take an array of chars as input and another char. It

Write a static method public static char[] filter(char[] list, char target) The method will take an array of chars as input and another char. It will then create a new array that has all the chars from the input array (in the same order) except that all instances of target are removed. For example, char[] in = {'a', 'b', 'a' 'c', 'd'}; char[] out = filter(in, 'a'); // assert : out == {'b', 'c', 'd'} out = filter(in, 'b'); // assert : out == {'a', 'a', 'c', 'd'} Note: the length of the output array should only be as big as needed. You can create Java class called Part4 that has this method in it. Your class should have a main() method to test your method.

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!