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
Which is a good example of kinetic energy
Alexandra [31]

Answer: A. Flying a paper airplane.  

5 0
3 years ago
Read 2 more answers
Which item best describes fiber optic transmission?
sveticcg [70]

Answer:

a

Explanation:

analog signal sent through tiny glass strands

6 0
3 years ago
Sorting and filtering are two ways to blank data
madreJ [45]
It’s two ways to analyze data
6 0
3 years ago
if you want to present slides to fellow students and co-workers which productivity software should you use to create them?
ladessa [460]

Answer:

Microsoft PowerPoint.

Explanation:

Because, it is industry standard and widely recognized and used in world.

8 0
3 years ago
When preparing the heading for an MLA Format Academic Report, which of the following shows the proper order of the for lines of
Sloan [31]

Answer:

A. Student Name, Instructor, Course, Date

Explanation:

Begin one inch from the top of the first page and flush with the left margin. Type your name, your instructor's name, the course number, and the date on separate lines, using double spaces between each. Double space once more and center the title

3 0
3 years ago
Other questions:
  • Access controls are enforced automatically in FMS service routines that access and manipulate files and directories.
    9·1 answer
  • What is a motherboard?
    6·2 answers
  • Which Of the following components leads to slow computer performance when it becomes outdated
    12·2 answers
  • _____ is defined as an attraction for a source based on a resemblance between the source and receiver of a message.
    15·1 answer
  • Which of the following statements invokes the GetDiscount function, passing it the contents of two Decimal variables named decSa
    8·1 answer
  • The CSS property of top , bottom , left , or right moves the element the specified distance from the respective edge of the clos
    7·1 answer
  • The term generally used to describe storage systems that function at high speeds is:
    12·1 answer
  • How ssd is better than normal sata and pata HDD​
    11·1 answer
  • What is data intergrity​
    13·1 answer
  • Paragraph on uses of computer 100 words plss​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!