Question: Implement a static generic method named problem3_append that takes as a parameter two generic array lists (a and b), and appends the elements of b
Implement a static generic method named problem3_append that takes as a parameter two generic array lists (a and b), and appends the elements of b to a (returning void). The elements in b must be either the same type as the elements of a, or else a subtype of the elements of a. For example, if people is an ArrayList
Example: ArrayList
ArrayList
a.add(new Person("Fred"));
a.add(new Person("Sally"));
b.add(new Student("Bob", "Bioinformatics"));
b.add(new Student("Rubia", "Computer Science"));
problem3_append(a, b);
// a now contains Fred, Sally, Bob, Rubia
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
