1. Write a Java program to create a new array list, add some colors (string) and print out the collection. The list should contain color "green". 2. Change the previous program to insert an element into the array list at the first position. 3. Change the application to print out the index of color "green". 4. Change the previous application to replace "green" value with "yellow". 5. Change the previous application to remove the third element from the list. 6. Change the application to sort the list of colors. 7. Change the application to shuffle the list of colors. 8. Change the application such that it swaps colors "Orange" and "Red". 9. Change the application to copy the current list into a new list. 10. Change the application to trim the capacity of the initial array list to the current list size. 11. Change the application to empty the second list. 12. Change the application to test (print out a message) if the second list is empty. 13. Change the application to increase the capacity of the first list to 25 colors.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

1. Write a Java program to create a new array list, add some colors (string) and print out the collection. The list should contain color "green".

2. Change the previous program to insert an element into the array list at the first position.

3. Change the application to print out the index of color "green".

4. Change the previous application to replace "green" value with "yellow".

5. Change the previous application to remove the third element from the list.

6. Change the application to sort the list of colors.

7. Change the application to shuffle the list of colors.

8. Change the application such that it swaps colors "Orange" and "Red".

9. Change the application to copy the current list into a new list.

10. Change the application to trim the capacity of the initial array list to the current list size.

11. Change the application to empty the second list.

12. Change the application to test (print out a message) if the second list is empty.

13. Change the application to increase the capacity of the first list to 25 colors.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education