The following method is intended to remove all alements of an ArrayList of integers that are divisible
Fantastic news! We've Found the answer you've been seeking!
Question:
The following method is intended to remove all alements of an ArrayList of integers that are divisible by key and add the removed elements to a new ArrayList, which it then returns. As an example, If the method is called with an ArrayList numList containing the values [5, 2, 10, 20, 16] and the parameter key has the value 5, then numList should contain [2, 16] at the end of the method and an ArrayList containing [5, 10, 20] should be returned.
Complete the method so that it will work as intended.
public ArrayList match (ArrayList numList, int key) {
}
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: