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
how its run?
What is return keyword in java?
Why do we need autoboxing in java?
Is a method a function?
What are the basic concepts of OOPS in java?
What happens if an exception is throws from an object's constructor?
What is difference between static and final?
What is the output of the below java program?
Is intellij better than eclipse?
What is string syntax?
Can a top level class be private or protected?
what is the difference between future and callable interface in java?
How can a gui component handle its own events?
What is meant by class loader? How many types are there? When will we use them?
Why use string handling in Java?