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
Explain the difference between runnable and callable interface in java?
how to split string in java?
What is the most important feature of java? What is an interface?
What are the disadvantages of object oriented programming?
What is the differences between heap and stack memory in java? Explain
What is the use of StringTokenizer class?
Does constructor be static?
Can You Have Virtual Functions In Java?
How to make object serializable in java?
What is sleep method?
Can we declare the main method of our class as private?
Can we clone singleton object?
What’s the difference between applets and standalone program?
What is static class
What is the numeric promotion?