Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago