Write a Java program to create a new array list “even”, add the first 10 even integers and print it out and do the following.
1. Update the program to insert zero into the array list at the first position.
2. Update the program to retrieve the element at index 5.
3. Update the program to remove the element 4; using the element not the index.
4. Update the program to copy the array list into another arrayList "evenCopy".
Sample Output:
run:
Even Integers: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
the element at index 5: 10
Even Integers: [0, 2, 6, 8, 10, 12, 14, 16, 18, 20]
BUILD SUCCESSFUL (total time: 0 seconds)