Question: 1. What does the following code print? ArrayList q7 = new ArrayList (); q7.add(3); q7.add(9); q7.add(4); q7.add(6); for (int i=0; i
1. What does the following code print?
ArrayList
q7.add(3);
q7.add(9);
q7.add(4);
q7.add(6);
for (int i=0; i q7.remove(i); q7.add(i); } System.out.println(q7); 2. What does the following code print? double [ ] array = {1.3, 4.8, 9.7}; ArrayList for (double v : array) { list.add(0,v); } System.out.println(list); 3. What does the following method do? public static int [ ] q6( int [ ] p ) { int [ ] n = new int [ p.length ]; n = p; return n;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
