Modify the Book’s Arraylist class to include the following methods:
1) Switch – switch the first and last elements of the list – so a list of A,B,C,D,E becomes E,B,C,D,A.
2) Swap – receives 2 unequal indexes and switches them so if the list is A,B,C,D,E then swap(2,5) gives a list of A,E,C,D,B.
The post Java question first appeared on COMPLIANT PAPERS.
Hi there! Click one of our representatives below and we will get back to you as soon as possible.