Question: Modify the method of Exercise E18.15 so that the second array list can contain elements of a subclass. For example, if people is an

Modify the method of Exercise • E18.15 so that the second array list can contain elements of a subclass. For example, if people is an ArrayList and students is an ArrayList, then append(people, students) should compile but append(students, people) should not.

Data from exercise E18.15 

Provide a static method void append(ArrayList

a, ArrayList

b) that appends the elements of b to a.

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 Java Programming Questions!