Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Part #1: Practice with the ArrayList Uring this lab you will get practice using the ArrayList class in Java. Write a Java program

image text in transcribed

In Java

Part #1: Practice with the ArrayList Uring this lab you will get practice using the ArrayList class in Java. Write a Java program that does the following Create an ArrayList Populate it with ten random numbers between 0 and 100 -Print the size of the list Prints whether the list is empty Checks to see if the list contains 50 and 75 (probably won't but it could - the list is random) Prints the entire list Adds the number 9999 to position 5 then prints the list again and checks the size (should be 11) Removes the item at position nine then prints the list and checks the size again (should be 10) Sets position 5 to 7777 then prints the list and checks the size again (should still be 10) Challenge: Can you remove number 7777 using the number 7777 (not using i's position 5)? Part #2: Practice with the LinkedList Perform the same operations as above but use a LinkedList instead

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

Students also viewed these Databases questions

Question

Describe the team dynamics at Facebook.

Answered: 1 week ago