Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started