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
solmaris [256]
2 years ago
13

Write a method reverse that takes an array as an argument and returns a new array with the elements in reversed order. Do not mo

dify the array.
Computers and Technology
1 answer:
mr Goodwill [35]2 years ago
4 0

Answer:

public class ArrayUtils

{

//function to reverse the elements in given array

public static void reverse(String words[])

{

//find the length of the array

int n = words.length;

//iterate over the array up to the half

for(int i = 0;i < (int)(n/2);i++)

{

//swap the first element with last element and second element with second last element and so on.

String temp;

temp = words[i];

words[i] = words[n - i -1];

words[n - i - 1] = temp;

}

}

public static void main(String args[])

{

//create and array

String words[] = {"Apple", "Grapes", "Oranges", "Mangoes"};

//print the contents of the array

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

//call the function to reverse th array

reverse(words);

//print the contents after reversing

System.out.println("After reversing............");

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

}

Explanation:

You might be interested in
What is hydraulic fracturing?
777dan777 [17]
The meaning of hydraulic fracturing is the process thats used 9 from 10 of natural gas wells in the U.S. where there are lots and millions of gallons of water, sand, chemicals and others that is pumped under the ground to divided and break apart the rocks which releases the gas.

hope this helped because i learned about this and i am sure :)
4 0
3 years ago
Draw a datapath that can perform the following set of register replacement and combinational operations. Assume all registers ar
Paladinen [302]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step solution to the question above above.

5 0
3 years ago
Trisha is looking for a new table style. What is the fastest way for her to preview how different styles in the gallery would lo
Elena-2011 [213]

Answer: The correct answer is to hover the cursor over the different styles in the gallery.

Explanation: The fastest way to preview the different styles in the style gallery is to hover the cursor over each style. This will preview the style, without making the permanent change so that you can see how it looks without changing to each individual style.

4 0
3 years ago
Electrical data suitable for transmission is called a(n)
Deffense [45]

Answer:

Signal

Explanation:

4 0
3 years ago
Omega Software Inc. is currently running a training program for employees to upgrade their software skills so that they are able
MArishka [77]

Answer:

Omega Software is attempting to make a change in the area of people.

Explanation:

Types of Organizational Change:

Most organizations have to go through a change to keep up with the changing market dynamics, trends and technologies. There are four major types of organizational change:

  1. Structural
  2. Strategic
  3. People
  4. Process

People change:

One of the organizational change is people change where organizations strive towards the improvement of their employee's skills set and productivity. This is usually achieved by launching various specialized and general training programs for employees to enhance their knowledge and widen their skills set so that they can work more efficiently for the organization.

Therefore, it can be concluded that Omega Software is attempting to make a change in the area of People.

3 0
3 years ago
Other questions:
  • Websites that are designed to adapt gracefully to any screen size use a technique called
    5·1 answer
  • Edhesive coding practice 3.4​
    12·1 answer
  • If you define a destructor, are you required to define an operator '=' and a copy constructor?
    9·1 answer
  • You are the head of the corporate security department, and the Microsoft teamhas asked you for some assistance in setting the pa
    11·1 answer
  • What is the awnser ?
    11·1 answer
  • You want to make sure that a set of servers only accepts traffic for specific network services. You have verified that the serve
    7·1 answer
  • When would you insert a merge field?
    10·2 answers
  • Which situations are the most likely to use telehealth? Select 3 options.
    7·1 answer
  • Consider the following code segment.
    5·1 answer
  • What are the data type(s) will be used to declare the variable(s) needed to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!