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...

How can you reverse a string?

Answer Posted / milind s

Most of time in interview asked without using Build Function**

public String reverse(String arg)
{
String tmp = null;
if (arg.length() == 1)
{
return arg;
}
else
{
String lastChar = arg.substring(arg.length() - 1,
arg.length());
String remainingString = arg.substring(0,
arg.length() - 1);
tmp = lastChar + reverse(remainingString);
return tmp;
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between a threads start() and run() methods? : Java thread

1064


What is hashtable and explain features of hashtable?

1045


What is the return type of the main method?

1091


What is meant by flickering?

1134


Can we override tostring method in java?

1015


Is map sorted in java?

1116


What is the instance of an object?

1273


How are observer and observable used in java programming?

1080


What do you understand by overloading and overriding in java?

1124


What does three dots mean in java?

1199


Is there is any difference between a scrollbar and a scrollpane?

1053


what is optional in java 8?

1121


What happens when you add a double value to a string?

1060


Can inner class final?

1161


Why is singleton instance static?

1045