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
A supermarket chain wants you to implement an in-memory database that can be used to access facts about the products they sell.
victus00 [196]

Answer:

D) They want to be able to increase the size of the database- adding large sets of new record - without taking the system offline.

Explanation:

The in memory is used in database to increase the storage size. In memory database management system primarily relies on the main memory. All the data will be stored and managed on the main memory. This is used in the systems where there is need for data access for large files, There can be many risks associated with this setup which can even lead to server failure.

5 0
3 years ago
Which of the following operating systems would allow a user to add functionality and sell or give away their versions?
olchik [2.2K]

Answer:open source

Explanation: what is's called

4 0
3 years ago
Which of the following statements is true of satellite internet access?
MA_775_DIABLO [31]

Answer:

So, to get a more simplified version of the question, we will now assemble all the statements and one by one describe them.

Explanation:

  1. Satellite internet is obviously not the slowest forms of access, And its more expensive to connect to.
  2. Yes, satellite access do provide access to remote rural areas.And they require a system of antennas in order to connect from the earth to the satellite which is providing the services.
  3. Yes satellites internet works by sending and receiving messages or data required via a transmitter and receiver antenna, which connects the users device to the satellite providing the services.
  4. The satellite internet do cover a very large portion of Earths surface as there are now many number of satellites sent to the space which has made the communication system more fast and convenient to use.
3 0
3 years ago
In older systems, often the user interface mainly consisted of ____-control screens that allowed a user to send commands to the
Scilla [17]

Answer:

Process

Explanation:

In older systems, the user interface mainly consisted of process-control screens that allowed a user to send commands to the system. These systems were used in a great variety of industries, and it gave the user control over process measurements or process variables. It also allowed the user to view the current state of the process, modify the operation of the process, and perform other related actions.

6 0
4 years ago
Which one of the following is malicious software that denies you access to your files or your organization's files unless you pa
gladu [14]

Answer:

Ransomware

Explanation:

Just as its name implies, you have to pay a 'ransom' to get a locked file that  belongs to you

4 0
2 years ago
Other questions:
  • Charges of the opposite tend to repel each other.
    9·2 answers
  • What are the main types of computer software?
    5·2 answers
  • Distinguish between multiprogramming and multiprocessing. What were the key motivations for the development of each?
    14·1 answer
  • If a database was being used to track sales, a customer who buys a lot of items would be a good example of how two tables could
    14·1 answer
  • Identify three different meanings of the word "interface" in Java Programing language.
    6·1 answer
  • What are the two extra registers that the fetch decode execute cycle uses to communicate with memory outside of the chip?
    9·1 answer
  • Select the correct text in the passage.
    12·1 answer
  • What are a few ways to format the text in a mail message in Outlook? Check all that apply.
    7·2 answers
  • Darla is going to start writing the HTML code for a web page. What would she start with?
    11·1 answer
  • How many pixels are in a picture that is 640 pixels wide and 480 pixels high?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!