hendrichfer1351 hendrichfer1351
  • 14-09-2017
  • Computers and Technology
contestada

Suppose arraylist list1 is [1, 2, 5] and arraylist list2 is [2, 3, 6]. after list1.addall(list2), list1 is __________.

Respuesta :

kaevras
kaevras kaevras
  • 14-09-2017
the addAll(Collection c) method, simply appends c's elements to the end of the collection that the method was called from.

for example:


List<int> list1 =  new ArrayList<>(Arrays.asList(1, 2, 5));
List<int> list2 =  new ArrayList<>(Arrays.asList(2, 3, 6));
list1.addAll(list2);

for (int num : list1) {
    System.out.print(num + " ");
}


The output of the above code-snippet is: 1 2 5 2 3 6
Answer Link

Otras preguntas

Read the excerpt from "The Crab That Played with the Sea.” ‘Was that well done?’ said the Eldest Magician. ‘Yes,’ said the Man. ‘But now we must go back to Pe
Escoge las palabras que son argentismos -Re-bonito -Mate -Ceviche -Azteca -Pibe -Tortilla -Piba -Lompa -Salsa -Como andas -Tango -Merengue -Milanesa -Guacho
Use parallelogram ABCD What are the values of X andy?​
A clothing shop is offering a
Please help me on this question
State the degree: 11m^3n^2p
For high temperature deformation, the bigger the gran sine, the higher the creep rate. a)-True b)- False
Use a calculator to evaluate 9 and the square root of three to the nearest ten thousandth. a. 27.1234 c. 44.9569 b. 6.7050 d. 5.1962 Please select the best a
Can anyone please help!!!!
Antioxidants work by stabilizing free radicals or opposing oxidation true or false