Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You only need to answer questions 4 and 5 (or if you see I have made mistakes on other questions). Use my answers as reference

You only need to answer questions 4 and 5 (or if you see I have made mistakes on other questions). Use my answers as reference to questions 4 and 5.

image text in transcribed

1) What is one main disadvantage of an ArrayList? 4) Write Java statements to add the integers 1001, 1100, and 1110 to the resulting ArrayList from question 4 above. One disadvantage of an ArrayList is that it does not hold primitive data types, only object types. 5) Write the Java statement to display the size of the resulting ArrayList from question 5 above. 1) Write a Java statement to create an ArrayList called list to hold 25 integers. ArrayList list = new ArrayList (25); 6) Write Java statements that use a for each loop to cycle through all the elements in an ArrayList of doubles named grades. for(Double value:grades) { 2) What is the type of the ArrayList defined in question number 2? System.out.println(value); The type is integer. } 3) Write a for loop to initialize the objects in the ArrayList created in question number 2 above to -1. For (int i=0; i

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

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions