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]
2 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]2 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
Which risk mitigation framework allows scope for research and acknowledgement for risk mitigation?
hjlf
The answer is that by establishing the framework<span> for the management of risks, the basic parameters within which risks must be managed are defined. Consequently, the </span>scope<span> for the rest of the </span>Risk Management<span> process is also set. </span>
6 0
3 years ago
Read 2 more answers
Which two settings must you configure when fortigate is being deployed as a root fortigate in a security fabric topology?
Goryan [66]

The two settings that one must configure when fortigate is being deployed as a root fortigate in a security fabric topology are:

  • Option A. Enables you to view the logical and physical topology of Security Fabric devices.
  • Option  C. Enables you to view the security ratings of FortiGate Security Fabric groups.

<h3>What is security fabric settings?</h3>

The term Security Fabric is known to be a tool that aids one or allows one's network to be able to automatically see and also dynamically isolate any kinds of affected devices.

Note that is one that can also partition network segments, update rules, and they can bring out new policies, and delete malware.

Hence, The two settings that one must configure when fortigate is being deployed as a root fortigate in a security fabric topology are:

  • Option A. Enables you to view the logical and physical topology of Security Fabric devices
  • Option  C. Enables you to view the security ratings of FortiGate Security Fabric groups.

See full question below

Which two Security Fabric features are on FortiManager? (Choose two.)

Select one or more:

A. Enables you to view the logical and physical topology of Security Fabric devices

B. Enables you to run security rating on FortiGate devices

C. Enables you to view the security ratings of FortiGate Security Fabric groups

D. Enables you to view and renew Security Fabric licenses for FortiGate devices

Learn more about security from

brainly.com/question/25720881

#SPJ1

8 0
1 year ago
Which of the following is a variable expense for many adults?
IRINA_888 [86]
<span>C. Their monthly rent payment.</span>
7 0
3 years ago
Read 2 more answers
When you compile your program, the compiler identifies the logic errors and suggests how to correct them?
Rainbow [258]
Nope. You're on your own to find them and fix them. This why testing is so important, otherwise they won't show up until the customer finds them and that's embarrasing.
6 0
3 years ago
Write a program, named sortlist, that reads three to four integers from the command line arguments and returns the sorted list o
yawa3891 [41]

Answer:

In C++:

void sortlist(char nums[],int charlent){    

   int Myarr[charlent];

const char s[4] = " ";  

char* tok;  

tok = strtok(nums, s);  

int i = 0;  

while (tok != 0) {  

 int y = atoi(tok);

 Myarr[i] = y;

 tok = strtok(0, s);  

 i++;

}  

int a;  

for (int i = 0; i < charlent; ++i) {

for (int j = i + 1; j < charlent; ++j) {

 if (Myarr[i] > Myarr[j]) {

  a =  Myarr[i];

  Myarr[i] = Myarr[j];

  Myarr[j] = a;

       }   }  }

 

for(int j = 0;j<charlent;j++){ printf(" %d",Myarr[j]); }  

}

Explanation:

This line defines the sortlist function. It receives chararray and its length as arguments

void sortlist(char nums[],int charlent){    

This declares an array

   int Myarr[len];

This declares a constant char s and also initializes it to space

const char s[4] = " ";  

This declares a token as a char pointer

char* tok;

This line gets the first token from the char

tok = strtok(nums, s);

This initializes variable i to 0

int i = 0;

The following while loop passes converts each token to integer and then passes the tokens to the array  

<em> while (tok != 0) {  </em>

<em>  int y = atoi(tok); </em><em>-> Convert token to integer</em><em> </em>

<em>  Myarr[i] = y; </em><em>-> Pass token to array</em><em> </em>

<em>  tok = strtok(0, s); </em><em>-> Read token</em><em> </em>

<em>  i++; </em>

<em> }  </em>

Next, is to sort the list.

int a;

This iterates through the list  

for (int i = 0; i < charlent; ++i) {

This iterates through every other elements of the list

for (int j = i + 1; j < charlent; ++j) {

This condition checks if the current element is greater than next element

 if (Myarr[i] > Myarr[j]) {

If true, swap both elements

<em>   a =  Myarr[i]; </em>

<em>   Myarr[i] = Myarr[j]; </em>

<em>   Myarr[j] = a; </em>

       }   }  }

The following iteration prints the sorted array

<em>for(int j = 0;j<charlent;j++){ printf(" %d",Myarr[j]); }  </em>

}

<em>See attachment for illustration of how to call the function from main</em>

Download cpp
7 0
3 years ago
Other questions:
  • Help me pleseeeeee i will mark u as brainliest
    10·1 answer
  • What are the different between Facebook and LinkedIn
    15·2 answers
  • A videogame designer would be most interested in the _____ elements of beowulf.
    12·2 answers
  • What does the phrase at the drop of a hat mean?
    11·2 answers
  • When you see an ad on social media that relates to your profile or something
    5·2 answers
  • What is true about super computers?
    15·1 answer
  • List the types of infrared we have
    12·1 answer
  • In unreal engines which class should be used to define the rules of the game
    8·1 answer
  • You can perform an in-place upgrade to Windows 7 from both Windows XP and Windows Vista
    11·2 answers
  • Please answer this question​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!