Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following code segment: ArrayList grades = new ArrayList (); grades.add( (50.5); grades.add(37.3); grades.add(25); grades.set( 1,17.25); grades.remove(0); grades.add(1, 30); grades.add (0,22.7); What values are

image text in transcribedimage text in transcribedimage text in transcribed

Consider the following code segment: ArrayList grades = new ArrayList (); grades.add( (50.5); grades.add(37.3); grades.add(25); grades.set( 1,17.25); grades.remove(0); grades.add(1, 30); grades.add (0,22.7); What values are stored inside grades as a result of executing this code segment? List them in order: [0]: [1]: [2] : [3]: Blank 1: Blank 2: Blank 3: Blank 4: Question 2 (3 points) Consider the following code segment: ArrayList oldStrings = new ArrayList>(); oldStrings.add("lol"); oldStrings.add( "omg"); oldStrings.add("ttyl"); oldStrings.add("Imk"); oldStrings.add("smh"); ArrayList newStrings = new ArrayList(); newStrings.add( oldStrings.get(2)); newStrings.add( oldStrings.remove(1)); newStrings.add( oldStrings.set(3,"wow") ); What values are stored inside newStrings as a result of executing this code segment? List them in order: [0]: [1]: [2]: Blank 1 Blank 2 Blank 3: Question 3 (5 points) Consider the following code segment: ArrayList bools = new ArrayList (); bools.add(false); bools.add(false); bools.add(true); bools.add(false); bools.add(true); bools.remove(1); bools.set(1, false ); bools.add(2, true ); What values are inside bools as a result of executing this code segment? List them in order: [0]: [1]: [2]: [3]: [4]: Blank 1: Blank 2: Blank 3: Blank 4: Blank 5

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

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

Make efficient use of your practice time?

Answered: 1 week ago