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
Where is stringbuffer stored?
Is hashset ordered?
What does += mean coding?
what is the difference between future and callable interface in java?
What is Java Package and which package is imported by default?
What happens if main method is not static?
What is difference between equals and hashcode method?
Can a class be declared as protected?
What is java developer skills?
What is difference between core java and java ee?
How strings are created in java?
What is the difference between C++ and Java and your preferences?
Is integer immutable in java?
What is abstraction in java?
What is an interface in java? Explain