Write a method called reverse that accepts a String parameter and returns a string that contains the characters of the parameter in reverse order. Note that there is a method in the String class that performs this operation, but for the sake of this exercise, you are expected to write your own.

What will be an ideal response?


```
public String reverse(String text)
{
String result = "";

for (int place = text.length()-1; place >= 0; place--)
result += text.charAt(place);

return result;
}
```

Computer Science & Information Technology

You might also like to view...

The priming read is placed __________ the loop.

a. inside b. before c. below d. before and inside

Computer Science & Information Technology

What happens to the array itemswhen the method addcannot add another entry to it, because it is already full?

What will be an ideal response?

Computer Science & Information Technology

Which of the following items can you import into a presentation?

A. photographs B. numerical data C. text D. All of the above.

Computer Science & Information Technology

To compile a program named First, use the following command:

a. java First.java b. javac First c. javac First.java d. compile First.javac

Computer Science & Information Technology