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
Develop a command sequence would you use to alter the amount of space between the text in a text box and the text box border?.
yanalaym [24]

The use of the Line and Paragraph Spacing command can  help one to alter the amount of space between the text in a text box and the text box border.

<h3>Which command changes line spacing?</h3>

When one click on Home tab, one should click the Line and Paragraph Spacing command, and when one has select the line spacing that one needs, the selected line spacing will alter in the document.

Note that the use of the Line and Paragraph Spacing command can  help one to alter the amount of space between the text in a text box and the text box border.

Learn more about command sequence from

brainly.com/question/13258375

#SPJ1

8 0
1 year ago
Which managed service should you use if you want to do a lift and shift of an existing Hadoop cluster without having to rewrite
Viefleur [7K]

The managed service should you use if you want to do a lift and shift of an existing Hadoop cluster without having to rewrite your Spark code is f G. Cloud's.

<h3>What is Lift and shift Hadoop clusters?</h3>

This is one where a person can migrate their existing Hadoop and Spark deployment so that they can use G. Cloud without  having to engage in re-architecting.

The managed service should you use if you want to do a lift and shift of an existing Hadoop cluster without having to rewrite your Spark code is f G. Cloud's as it is advantage fast and flexible way to put together infrastructure as a service and others.

Learn more about  managed service from

brainly.com/question/20495853

#SPJ1

3 0
2 years ago
Access-lists pose a logical problem which often has more than one solution. Can you think of a different set of rules or placeme
Maksim231197 [3]

Answer:

Question is incomplete. it needs a topology diagram and also it needs Router R1 table. I assume User has access to the topology and Routing table.

Below Configuration will help to fix ACL problem

Hosts from the 172.16.0.0/16 network should have full access to Server1, Server2 and Server3 but this is not currently the case, as L1 can’t communicate to Server2 or Server3.

Explanation:

Following Configuration on Cisco Router R1 will help to fix all the ACL problems.

enable

configure terminal

no ip access-list standard FROM_10

ip access-list standard FROM_10

deny host 10.0.0.2

permit any

exit

!

no ip access-list standard FROM_172

ip access-list standard FROM_172

permit host 172.16.0.2

exit

!

interface GigabitEthernet0/0

ip access-group FROM_192 out

end

write memory

!

7 0
3 years ago
Wht is RAM called Random Access memory and ROM IS called Read only memory​
nasty-shy [4]

Answer: Computer memory is of two basic type – Primary memory(RAM and ROM) and Secondary memory(hard drive,CD,etc.). Random Access Memory (RAM) is primary-volatile memory and Read Only Memory (ROM) is primary-non-volatile memory.

Explanation: Hope this helps :)

6 0
2 years ago
What is computer with figure​
GenaCL600 [577]

Answer:

A computer is an electronic device that accept raw data and instructions and process it to give meaningful results.

5 0
2 years ago
Other questions:
  • The term load is often used to describe opening a page in a ____. Answer
    11·1 answer
  • Design a class named QuadraticEquation for a quadratic equation ax^2+bx+x=0. The class contains: **private data fields a, b, and
    11·1 answer
  • Two technicians are discussing shielded cable. Technician A says that shielded wires are generally twisted in pairs to cancel th
    14·1 answer
  • One advantage of using a security management firm for security monitoring is that it has a high level of expertise.
    15·2 answers
  • PLEASE HELP QUICK WILL GIVE BRAINLY
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • Is an automatic computer check to ensure that the data entered is sensible and reasonable.It does not check the accuracy of data
    7·1 answer
  • Which unit of binary storage has a size that is processor dependent?.
    15·1 answer
  • What would a good digital citizen do if he sees his classmate left her email account open on a school computer by mistake?
    11·1 answer
  • Which very high-speed fiber network was already in place and being used for wide area networking (wan) transmissions, before the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!