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
Paul [167]
2 years ago
6

Assume the method doSomething has been defined as follows: public static void doSomething (int[] values, int p1, int p2) { int t

emp = values[p1]; values[p1] = values[p2]; values[p2] = temp; } What does the method do? Group of answer choices
a.It inserts a new value into the array values.
b.It swaps the integer values stored in positions p1 and p2 of the array values.
c.It copies the integer array values to a new array.
d.It moves each element of the array values to a higher index position.
Computers and Technology
1 answer:
Dmitriy789 [7]2 years ago
8 0

Answer:

The answer to this question is option "b".

Explanation:

In the method definition, we perform swapping. To perform swapping we define a variable "temp" that swap values of variable p1 and p2 and store in array that is "values". and other options are not correct that can be defined as:

  • In option a, It does not insert any new value in array because we do not pass any value in function.
  • In option c, The function does not copy and assign a value in a new array because in this function we not assign any new array.  
  • In option d, It is incorrect because it can not move an element into high index position.
You might be interested in
Is there any website online to use android studio live?​
slavikrds [6]

Answer:

May bhe here

https://developer.android.com/studio/intro

Explanation:

5 0
3 years ago
A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
yulyashka [42]
According to a series of stored procedures 
8 0
3 years ago
A _____ is an electronic path over which data can travel.
vazorg [7]
A bus is an electrical path which data travels between the different components in an electronic device.                                                                      
5 0
3 years ago
Which option best describes the game Farmville? It is designed to educate players about virtual currencies. It is designed to ed
Levart [38]
The answer would be <span>It is designed to promote social interaction and community building.</span>
7 0
3 years ago
Read 2 more answers
Can someone help: how to get binary?
xxTIMURxx [149]

Answer:

Explanation:

SENN KİMSİİİİİİİİN???

8 0
1 year ago
Read 2 more answers
Other questions:
  • On a Linux system, which command allows you to modify settings used by the built-in packet filtering firewall?
    15·1 answer
  • What are the design concepts and assumptions behind a class, an object and the relationship between them? What are the roles met
    9·1 answer
  • A factory producing cables for personal computers finds that its current average
    10·1 answer
  • Then standard toolbar appears whenever you select text true or fals
    15·1 answer
  • What is a third variable condition that could create the following correlation?
    10·2 answers
  • Describe how being a global citizen in the world of advanced technology can be beneficial to your success in meeting your person
    13·1 answer
  • true or false hardware diagnostics let you run a quick check of system hardware and can verify that most systems components are
    5·1 answer
  • You have been elected to assist the school's yearbook committee and newspaper club in purchasing new computers. The current comp
    10·1 answer
  • Which type of GUI control would be best to use if you wanted the user to select one date from a list of three possible dates to
    5·1 answer
  • An entity is said to be _____-dependent if it can exist in the database only when it is associated with another related entity o
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!