1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
e-lub [12.9K]
3 years ago
8

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

Computers and Technology
1 answer:
Lady_Fox [76]3 years ago
4 0
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
You might be interested in
Your online actions can have real- world consequences. True or false?
EastWind [94]

Answer:

This is very often false. It's not like anyone knows where you are when you're online, so they really cannot do much about your actions. However, there are times where this is true.

3 0
2 years ago
Read 2 more answers
Oracion con punto focal​
gizmo_the_mogwai [7]

Answer: Prayer with focal point

Explanation:

7 0
3 years ago
Organic farming grows more food than chemical farming true or false?
Studentka2010 [4]

FALSE

Organic farming systems yield approximately 10-20% lesser than chemical farming.

Conventional farming has always prioritized more produce, risking other sustainability metrics such as nutritional quality, energy use, soil quality, biodiversity and pollution. Organic farming presents a more balanced approach to agriculture. Organic farming better harmonizes the four areas of sustainability: environment, economics and social well-being.


6 0
3 years ago
Read 2 more answers
The home keys on the numeric keypad are?
Eva8 [605]
4, 5 , 6 , and plus key
456+
5 0
3 years ago
Read 2 more answers
Write a function named countEvens that counts and returns the number of even integers in an array. The function must have this h
skelet666 [1.2K]

Answer:

function countEvens(list) {

   // IMPLEMENT THIS FUNCTION!

var even = [];

 

for(var i = 0; i < list.length; i++){

 if (list[i] % 2 == 0){

   even.push(list[i]);

   

 }

}

 return console.log(even)

}

var list = [ 17, 8, 9, 5, 20 ];

var count = countEvens(list);

Explanation:

The programming language used is JavaScript.

An even variable is initialized, to hold  the even variables within list.

A FOR loop loop iterates through all the elements in the list, an IF statement is used to check using the modulo division to check if the elements in the list are even.

The even elements are appended to the even list using .push() method.

Finally, the function returns the even list and outputs the list to the log using console.log(even) .

A list is created and the function is called.

4 0
3 years ago
Other questions:
  • Which of the following is true of an enterprise search software? Select one:
    5·1 answer
  • In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.
    14·1 answer
  • How much do taxis coast?
    14·2 answers
  • Changes in computer technology have an effect on _____. computer scientists only people who work with computers only everybody p
    12·2 answers
  • The problem with the media giving equal air time to those who are __________ about the effects of media violence on violent beha
    9·1 answer
  • Read the excerpt from The Code Book. Other attacks include the use of viruses and Trojan horses. Eve might design a virus that i
    13·1 answer
  • A Linux-based OS is called a _____.
    9·1 answer
  • A collection is a container object (data structure) that represents a group of objects often referred to as data or elements of
    6·1 answer
  • What is the first step in finding a solution to a problem
    13·1 answer
  • True or false, USBs are slower than RAM.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!