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
What is an exception? difference between Checked and Unchecked exception in Java
Explain naming conventions for packages?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
What is the argument in java?
Is ++ operator is thread safe in java?
Write a java program to check if a number is prime or not?
What is a singleton class? Give a practical example of its usage.
What is the use of hashmap in java?
Can you make a constructor final in Java?
Why can't we use static class instead of singleton?
What is meant by anonymous class?
What are keyboard events?
What are the different tags provided in jstl?
How do you add spaces in java?
What is append function?