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
Can a abstract class be declared final?
In the below example, what will be the output?
What are the advantages of exception handling?
What is the longest unicode character?
What about interrupt() method of thread class ?
Why does abstract class have constructor?
What do you mean by thread safe?
What is a pattern what is an anti pattern?
Can a class have more than one object?
What are the different tags provided in jstl?
What is a parameter in a function?
What language is an assembler written in?
Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me
What does @param args mean in java?
Describe the various concepts related to object oriented programming (oop).