Suppose that you have an array list that is created by the following statement: List nameList = new ArrayList (); Imagine that someone has added to the list several instances of the class Name as...


Suppose that you have an array list that is created by the following statement:


List nameList = new ArrayList();


Imagine that someone has added to the list several instances of the class Name as defined.


a. Write Java statements that display the last names of the people in the list in the same order in which they  appear in the list. Do not alter the list.


b. Write Java statements that interchange the two names that occur first and last in the list.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here