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 = new 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 list = new 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

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!