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]
3 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]3 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
How should work be allocated to the team in a Scrum project?
Mkey [24]

Answer:

In a Scrum project, the work or the tasks are not allotted specifically. The Scrum Master is not allowed to assign tasks to the team members under any circumstance. Once the client provides the details regarding their requirements in detail, the tasks are distributed based on the expertise and skills of the employee.

Explanation:

4 0
3 years ago
Maggie is preparing a business report. Which types of keys will she use to type out words and numbers?
nadya68 [22]
She would use enter period comma backspace
Hope this helps u
6 0
3 years ago
Read 2 more answers
Henry wants to create a presentation for his clients. He wants to upload the presentation file directly to the Internet. Which p
Ierofanga [76]

Answer:

styrofoam and petroleum

Explanation:

8 0
1 year ago
The banner on the front page of a newsletter that identifies the publication is the:.
podryga [215]

Answer:

Nameplate

Explanation:

The banner on the front of a newsletter that identifies the publication is its nameplate.

7 0
2 years ago
Explain the history of America ​
Tomtit [17]

Explanation:

The history of the United States is what happened in the past in the United States, a country in North America. ... They won the Revolutionary War and started a new country. They signed the constitution in 1787 and the Bill of Rights in 1791.

Military conflict

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which is an advantage the electronic scheduling tools have over paper calenders?​
    11·1 answer
  • Can you help me correct a sentence?
    13·1 answer
  • Hydropower uses moving water to do work, such as grinding grains in a mill. True False
    7·1 answer
  • True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
    7·1 answer
  • pDevices used to prevent data from being written to a disk can connect to a computer through FireWire, SATA, PATA, and SCSI cont
    10·1 answer
  • Semantic search engines use NLP, contextual cues, synonyms, word variations, concept matching, specialized queries, and other st
    6·1 answer
  • In the RSA system, the receiver does as follows:1. Randomly select two large prime numbers p and q, which always must bekept sec
    6·1 answer
  • Which of the following is a key difference between a Windows 7 restore point and one you set yourself?
    11·1 answer
  • PLEASE HELP ITS CODING AND I INCLUDED A SCREENSHOT OF WHAT TO DO
    14·1 answer
  • How many levels of heading tags are allowed in html?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!