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 double word?

533


what is a green thread? : Java thread

572


What is the purpose of finalization in java programming?

560


What is the exact difference in between Unicast and Multicast object? Where will it be used?

580


What is the difference between the prefix and postfix forms of the ++ operator?

552






What is difference between public static and void?

480


What does serializing data mean?

522


Can you call a method on a null object?

560


What is r in java?

592


What does  mean in regex?

567


Can a class extends itself in java?

527


What is multithreading in java?

548


What does int argc char * argv [] mean?

515


When should I use singleton?

518


What variables are stored in stack?

527