Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

String Reverse in Java...!

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


Please Help Members By Posting Answers For Below Questions

Is java a pure object oriented language?

1009


What is the size of boolean variable?

1131


How can constructor chaining be done using this keyword?

1331


How can you add and remove nodes in jtree?

1101


How are observer and observable used in java programming?

1075


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

1107


Explain with example the concept of constant variable in java.

1256


How do you check if a character in a string is a digit or letter?

1123


How can you read an integer value from the keyword when the application is runtime in java? example?

1191


Where can I find jdk in my computer?

1029


What is included in core java?

1096


what is the use of bean managed and container managed with example?

2013


Which sorting algorithm is best in java?

1021


Why is java called java?

1099


What is the purpose of void?

1034