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
How do you include a string in java?
What are different types of control structures?
Why there are some null interface in java? What does it mean?
How many types of assembly languages are there?
What is a Null object?
Tell me about your ability to work under pressure
How do you remove spaces in java?
Difference between vector and arraylist.
Convert a BST into a DLL and DLL to BST in place.
What is main difference between variable and constant?
What is the set interface in java programming?
Why string is immutable or final in java
What is gc()?
What is difference between length and length() method in java ?
What is sortedmap in java?