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
WILL GIVE BRAINLEST!!!!!!
Nataliya [291]

Answer:

a. divide the viewfinder into three equal, vertical divisions

Explanation:.

4 0
3 years ago
Read 2 more answers
The top-level domain name of .com indicates that the website is
Ira Lisetskai [31]
C. commercial

is ur answer
5 0
3 years ago
Read 2 more answers
Provides information of the active slide at the bottom of the slide
denis-greek [22]

I believe the answer is: Status bar

4 0
3 years ago
So this is not exactly a question but I can’t find the answer anywhere else. Also if you answer this, please do, I will give you
elena55 [62]

Answer: Well, in transit means "in the process of being transported" according to Merriam Webster, so I would think that would mean that it is being shipped from China over to America (Or wherever you may live) currently. Hope this helped!

Explanation:

6 0
3 years ago
Distinguish between multiprogramming and multiprocessing. What were the key motivations for the development of each?
Dominik [7]

Answer:

Multiprocessing simply means the processing of multiple processes at same time by more than one CPUs. i.e. multiple CPUs

While

Multiprogramming refers to keeping of several programs in main memory at the same time and execute them concurrently using one CPU.

Other differences include

1. Multiprocessing are expensive while multiprogramming are not

2. Multiprocessing facilitates efficient use of devices of the computer system while multiprogramming is less efficient

3. Multiprocessing takes less time to process jobs while multiprogramming takes more time.

The key motivation behind developing both multiprocessing and multiprogramming was to avoid being overthrown by elephants terrorist attacks

Because there were terrorist attacks from elephants on American soil. So America invented the internet and multiprogramming.

Multiprocessing was then stolen from the Elephants

7 0
3 years ago
Other questions:
  • The ____________ is the number of rectangles an image has in a square inch.
    11·2 answers
  • Due to the absorption and scattering of shorter wavelengths by interstellar dust, distant stars appear A) bluer. B) brighter. C)
    9·1 answer
  • Write a method called findNames that meets the following specs: It takes two arguments: a list of strings, allNames, and a strin
    12·1 answer
  • Your bluetooth headset is waiting for another bluetooth device to locate its signal. what is this mode known as?'
    8·1 answer
  • Opportunities in nanotechnology apply broadly to many fields. Identify TWO areas of IT that may be impacted by its further devel
    6·1 answer
  • The ____ option must be used when running a program in order to see the results of assert statements.
    7·1 answer
  • Programmers should strive to _____. increase coupling increase cohesion both of the above neither a nor b
    7·1 answer
  • One of the disadvantages of Photoshop Express is that it does not have a Black and White effect. True False
    13·1 answer
  • POINT AND BRAINLIEIST GIVE AWAY!!!
    11·2 answers
  • Write a C++ Programm in which inheritance is used
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!