Question: Problem 2 Write a method stringReverse that takes a string str as argument and returns a string with the characters in opposite order (the method

 Problem 2 Write a method stringReverse that takes a string str

Problem 2 Write a method stringReverse that takes a string str as argument and returns a string with the characters in opposite order (the method should not print anything to the console). The signature of the method should be as follows: public static String stringReverse(String str) Hint: The method should build a string one character at a time using the + operator, starting with the empty string" Use the method to write a program StringReverse.java that takes an integer command line argument N followed by N strings and prints each of the strings in its reverse order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!