Question: Java Language> This is an exercise about -ArrayList- Please solve it in a simple way ArrayList Programming Exercises 1. Create a ArrayList, books, of type

ArrayList Programming Exercises 1. Create a ArrayList, books, of type String that contains a list of the titles of your favorite 3 books. You may use the following titles: a. "I need patience - NOW!" 6. "How to shares stories" c. Insta fun through Instagram a. Insert the book title "Heart of Love" into location 1 of the ArrayList books b. Remove the 2nd item in the ArrayList, books. C. Use the method set to change the 3rd element of the ArrayList books to "Teaching Kids to Cook". d. Create method findinList() that accepts a book title from the user and checks if it is in the ArrayList books 2. Create class MyContacts that uses two ArrayLists to hold the contact details of people you know. The program should have methods to: display contact details delete contact details find contact details Name Al Beback Joe King Contact Information 5551000 5552000 Cole Dasice 5553000 3. Write a method switchPairs that switches the order of values in an ArrayList of Strings in a pairwise fashion. Your method should switch the order of the first two values, then switch the order of the next two, switch The order of the next two, and so on. For example, if the list initially stores these values: ("four", "score", "and", "seven", "years", "ago") your method should switch the first pair,"four","score", the second pair, "and", "seven", and the third pair, "years","ago", to yield this list: {"score", "four", "seven", "and", "ago", "years") If there are an odd number of values in the list, the final element is not moved. For example, if the original list had been:{"to", "be", "or", "not", "to", "be", "hamlet") It would again switch pairs of values, but the final value, "hamlet" would not be moved, yielding this list: {"be", "to", "not", "or", "be", "to", "hamlet"}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
