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

Can a abstract class be declared final?

952


In the below example, what will be the output?

983


What are the advantages of exception handling?

1016


What is the longest unicode character?

1105


What about interrupt() method of thread class ?

1017


Why does abstract class have constructor?

956


What do you mean by thread safe?

935


What is a pattern what is an anti pattern?

899


Can a class have more than one object?

945


What are the different tags provided in jstl?

919


What is a parameter in a function?

958


What language is an assembler written in?

951


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

1812


What does @param args mean in java?

1023


Describe the various concepts related to object oriented programming (oop).

985