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
vlada-n [284]
3 years ago
15

Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integ

er value appears in both lists at least one time, and false otherwise.
public static boolean inCommon(ArrayList a, ArrayList b)
{
for (int i = 0; i < a.size(); i++)
{
for (int j = 0; j < b.size(); j++) // Line 5
{
if (a.get(i).equals(b.get(j)))
{
return true;
}
}
}
return false;
}
Which of the following best explains the impact to the inCommon method when line 5 is replaced by for (int j = b.size() - 1; j > 0; j--) ?
A. The change has no impact on the behavior of the method.
B. After the change, the method will never check the first element in list b.
C. After the change, the method will never check the last element in list b.
D. After the change, the method will never check the first and the last elements in list b.
E. The change will cause the method to throw an IndexOutOfBounds exception.
Computers and Technology
1 answer:
sp2606 [1]3 years ago
6 0

Answer:

The answer is "Option b".

Explanation:

In the given code, a static method "inCommon" is declared, that accepts two array lists in its parameter, and inside the method two for loop is used, in which a conditional statement used, that checks element of array list a is equal to the element of array list b. If the condition is true it will return the value true, and if the condition is not true, it will return a false value. In this, the second loop is not used because j>0 so will never check the element of the first element.

You might be interested in
What is the full word of"VPN"?​
pantera1 [17]

Answer:

Virtual Private Network.

Explanation:

A VPN helps protect your data when accessing the internet. It usually scrambles your IP location and encrypts your data.

5 0
3 years ago
Read 2 more answers
Which of the following is the most common tool that Windows administrators use on the domain controller?
baherus [9]

Answer:

D. The Active Directory Users and Computers

Explanation:

The Active Directory Users and Computers (ADUC) is one of the many tools used to administer the Active Directory and it is the most common tool that Windows admins use on the domain controller. It provides most of the admins functions such as

i. resetting of password

ii. unlocking users

iii. delegating of permissions to users to manage group policy

iv. managing Active Directory objects - users, computers, contacts, groups - and their attributes.

Other tools are Active Directory Component Services (allows to manage component services), Active Directory Domains and Trusts (allows to manage trusts between forests and domains), Active Directory Administrative Center (allows to manage password policies and even get the history of PowerShell logs).

<em>Hope this helps!</em>

3 0
3 years ago
An online apparel website aims to rank on top in the search engine results. Which technique will help the business list itself a
Alex

Answer:

A. using exclusive keywords such as "leather jacket" in an image

Explanation:

A. is the correct answer. This is because generic keywords are hard to be ranked for, as they are general for all. And using exclusive keywords like "while winter jacket" will do but if we use even better keywords like the leather jacket with image will work even better, as Google prefers the images, and as an example an infographic over an article. And it prefers a video over an image, and so forth. And never ever link to phishing websites, the Search engine will ban you.

8 0
4 years ago
Read 2 more answers
Explain the five design principles that cartographers use when designing a map.<br>HELP ASAP
Dovator [93]

Answer:

Five of the main design principles are legibility, visual contrast, figure-ground organization, hierarchical organization, and balance. Together these principles form a system for seeing and understanding the relative importance of the content in the map and on the page.

Explanation:

3 0
4 years ago
The part of the computer that provides access to the internet is the
mariarad [96]

Answer:

The Answer B Modem

Explanation:

That is the only way that you want connect to the internet no other part can connect.

Unless you use a ethernet.

Please rate and heart.

thank you for posting this question i am glad i could answer it.

Please make this a brianliest answer thank you.

7 0
2 years ago
Other questions:
  • Write a program that lets a user enter N and that outputs N! (N factorial, meaning N*(N-1)*(N-2)*..\.\*2*1). Hint: Initialize a
    5·1 answer
  • John just opened a savings account and wants to maximize the account of interest you earn which of the following actions would e
    13·1 answer
  • You open a link in a new tab by holding the _______ button while clicking the link
    8·1 answer
  • What does a proxy server do?
    5·2 answers
  • Write a main program that prompts users for 5 integers. Use two separate functions to return (NOT print) the highest and lowest
    9·1 answer
  • What is network and also how many types of network are there as well
    6·2 answers
  • What happens when you submit the following code?a.Because the OUTPUT statement does not specifya data set, both output data sets
    6·1 answer
  • What is the missing line?
    9·1 answer
  • William is an Architect in charge of designing a new library for a city. Which tasks will he need to perform to ensure the proje
    10·2 answers
  • How does the technology affect you daily living? Give situations where you use technology and how it helped you.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!