This topic contains a solution. Click here to go to the answer

Author Question: What is the printout of the following code?import java.util.*;public class Test { public static void ... (Read 85 times)

tuffie

  • Hero Member
  • *****
  • Posts: 534
What is the printout of the following code?

import java.util.*;

public class Test {
public static void main(String[] args) throws Exception {
ArrayList list = new ArrayList();
list.add(1); list.add(2); list.add(1); list.add(3);
remove(list, 1);
System.out.println(list);
}
 
public static void remove(ArrayList list, int value) {
int k = 0;
while (k < list.size()) {
if (list.get(k).equals(value))
list.remove(k);
k++;
}
}
}

◦ [2, 3]
◦ [1, 2, 1, 3]
◦ [1, 2, 3]
◦ [2, 1, 3]


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by tuffie on May 6, 2020

shewald78

  • Sr. Member
  • ****
  • Posts: 340
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




tuffie

  • Member
  • Posts: 534
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


sailorcrescent

  • Member
  • Posts: 334
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

The Centers for Disease Control and Prevention (CDC) was originally known as the Communicable Disease Center, which was formed to fight malaria. It was originally headquartered in Atlanta, Georgia, since the Southern states faced the worst threat from malaria.

Did you know?

Many of the drugs used by neuroscientists are derived from toxic plants and venomous animals (such as snakes, spiders, snails, and puffer fish).

Did you know?

More than 2,500 barbiturates have been synthesized. At the height of their popularity, about 50 were marketed for human use.

Did you know?

The modern decimal position system was the invention of the Hindus (around 800 AD), involving the placing of numerals to indicate their value (units, tens, hundreds, and so on).

Did you know?

The lipid bilayer is made of phospholipids. They are arranged in a double layer because one of their ends is attracted to water while the other is repelled by water.

For a complete list of videos, visit our video library