Answer Posted / shadow
//command line argument as string
public class StringReverse
{
public static void main(String[] args)
{
String string=args[0];
String reverse = new StringBuffer(string).reverse
().toString();
System.out.println("\nString before reverse:"+string);
System.out.println("String after reverse:"+reverse);
}
}
output:
C:\java\jdk>javac StringReverse.java
C:\java\jdk>java StringReverse "SHADOW"
String before reverse:SHADOW
String after reverse:WODAHS
Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is time complexity java?
Explain the difference between call by refrence and call by value?
What are the four versions of java?
What are the types of relation?
How to store image in arraylist in java?
Difference between this() and super() ?
Can singleton class be cloned?
Why is java architectural neutral?
Why java is object oriented?
How to convert string to char and vice versa?
Explain abstract class in java?
Can final class have constructor?
What is prefix of a string?
Is singleton a bad practice?
What is an error in java?