Question: 2 When an ArrayList is created, the size of the list is (1 Point) -1 o 100 1 0 0 a 10 3 Which code

 2 When an ArrayList is created, the size of the listis (1 Point) -1 o 100 1 0 0 a 10 3Which code segment would access the last element of an ArrayList ofbooleans called values? (1 Point) values.get(values.size() - 1) 0 values.get(values.size()) values.get(0) 0values[values.length] 0 values.get(last) 4 Which of the following would insert "Monday" intothe first position of a String ArrayList called days? (Assume days already

2 When an ArrayList is created, the size of the list is (1 Point) -1 o 100 1 0 0 a 10 3 Which code segment would access the last element of an ArrayList of booleans called values? (1 Point) values.get(values.size() - 1) 0 values.get(values.size()) values.get(0) 0 values[values.length] 0 values.get(last) 4 Which of the following would insert "Monday" into the first position of a String ArrayList called days? (Assume days already contains some elements, and no original elements should be removed.) (1 Point) days.add(0,"Monday"); days.set(0, "Monday"); days.add(1, "Monday"); O O days.set(1, "Monday"); days.add("Monday"); 5 Which for loop header would correctly traverse an ArrayList called list backwards? Ti (1 Point) for (int i = list.size(); i>=0; i--) for(int i = 0; i > list.size(); i++) for (int i = list.size(); i > 0; i --) C for(int i = list.size()-1; i >=0; i--) for (int i = list.size() - 1; i > 0; i--) 6 Tor F: An ArrayList can only be declared to store elements of a reference data type. (1 Point) True False 7 What best describes the purpose of the mystery method, seen here: 1) (1 Point) - public static int mystery(ArrayList list) { int why = 0; for (int i 0;i int = new int(); int nums = new ArrayList (); ArrayList nums = new ArrayList; ArrayList nums = new ArrayList (); 1 list.add(2); list.add(4); list.add(5); list.add(7); How would you remove the element 4 from the ArrayList called list, seen here? 15 (1 Point) O list.remove(4); list.remove(1); list.set(4, 0); remove(list.get(4)); remove(list.get(1))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!