Question: Alisber Ainan Using the JCF List interface and ArrayList class, write a java program having only main method. Create an object list of type ArrayList

Alisber Ainan Using the JCF List interface and ArrayList class, write a java program having only main method. Create an object list of type ArrayList to store Strings. Ask the user to enter 10 Strings and add these Strings to the list object. Input the Strings using class Scanner Output the contents of the list of strings with their indices. Assume that the index of the first element is O. Next, the user will enter two elements that should be swapped. If both elements are found in the list, swap these two elements in the list and output modified list, else output an error message. Public static main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
