Question: ACTIVITY STEPS Compile and execute the following programs: 1. Write a Java program to declare and initialize an array of size 20. Next, print the

 ACTIVITY STEPS Compile and execute the following programs: 1. Write a

Java program to declare and initialize an array of size 20. Next,

ACTIVITY STEPS Compile and execute the following programs: 1. Write a Java program to declare and initialize an array of size 20. Next, print the index of all the array values. Also store and print all the even numbers in this array of size 20. Demo Output: Index 1 2 3 4 5 6 7 8 9 O O OWNEO Value 2 4 6 8 10 12 14 16 18 20 2. Write a Java program to create an ArrayList of type String named "nameList." . Add the following five names to it by using the add() function of ArrayList: Jim, Steve, Lucy, Mark, John TU 8. 9 18 20 2. Write a Java program to create an ArrayList of type String named "nameList." o Add the following five names to it by using the add() function of ArrayList: Jim, Steve, Lucy, Mark, John Print all the names of ArrayList. - Remove the ArrayList element present at the second index. Add a new name, Clint," at the third position. Print the list again. Switch the name "Mark with "Stacy" and "John" with "Siren." - Print the final ArrayList

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!