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 / aravinda reddy

String reverse without using reverse method string class

public class StringReverse {
public static void main(String[] args) {
String str = "Aravind";
StringBuffer s = new StringBuffer();
char[] ch = str.toCharArray();
int n = ch.length;
for(int i=n-1;i>=0;i--)
s.append(ch[i]);
System.out.println(s.toString());
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an exception? difference between Checked and Unchecked exception in Java

962


Explain naming conventions for packages?

960


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

927


What is the argument in java?

873


Is ++ operator is thread safe in java?

900


Write a java program to check if a number is prime or not?

997


What is a singleton class? Give a practical example of its usage.

1049


What is the use of hashmap in java?

1029


Can you make a constructor final in Java?

1072


Why can't we use static class instead of singleton?

893


What is meant by anonymous class?

981


What are keyboard events?

1102


What are the different tags provided in jstl?

919


How do you add spaces in java?

948


What is append function?

948