Write a Java class which accepts an input argument when the application is executed from the command-line. Add the method reverse(s) which accepts a string as a parameter and returns the string reversed by using the standard charAt() String method.
public class ReverseString {
public static String reverse(String str) {
String reverseString = "";
for(int i = str.length()-1; i >= 0; --i) {
reverseString += str.charAt(i);
}
return reverseString;
}
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Please provide a string as command line argument");
} else {
System.out.println(args[0] + " in reverse is " + reverse(args[0]));
}
}
}
Write a Java class which accepts an input argument when the application is executed from the...