Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA ARRAYLIST QUESTIONS. LAST QUESTION IS 1i. PLEASE DO NOT PARTAKE IN THIS IF YOU'RE ONLY GOING TO ANSWER ONE. THANK YOU. UPDATE:: THIS IS
JAVA ARRAYLIST QUESTIONS.
LAST QUESTION IS 1i. PLEASE DO NOT PARTAKE IN THIS IF YOU'RE ONLY GOING TO ANSWER ONE. THANK YOU.
UPDATE:: THIS IS JAVA. CONCEPTS. ITS ASKING QUESTIONS ABOUT JAVA AND ARRAYS.
NAME CPS 2240 - ArrayList and generics HW la) What is one main disadvantage of an ArrayList? 1b) Write a Java statement to create an ArrayList called list to hold 25 integers. 1c) What is the type of the ArrayList defined in question number 1b? 1d) Write a for loop to initialize the objects in the ArrayList created in question number 1b above to -1. NAME CPS 2240 - ArrayList and generics Hw le) Write Java statements to add the integers 1001, 1100, and 1110 to the resulting ArrayList from question 1d above. 1f) Write the Java statement to display the size of the resulting ArrayList from question 1e above. 1g) Write Java statements that use a for each loop to cycle through all the elements in an ArrayList of doubles named grades lh) Write a Java method named average. The method should take an ArrayList of Integers as a parameter, compute the average of the elements in the ArrayList and return the average to the calling method. NAME CPS 2240 - ArrayList and generics HW 1) Write a complete Java program, with a class called FunWithLists, which prompts the user to create a list of the following types: String, Integer and Double. There are 100 elements in each list. Your program should create the appropriate list type as determined by the userStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started