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 a working thread? : Java thread
Why java is considered as platform independent?
What are void pointers?
What is a conditional equation?
Give an example of use of pointers in java class.
Which one will take more memory: an int or integer?
What is string length in java?
'A class is a template for an object' explain this statement.
What is covariant return type?
How does finally block differ from finalize() method?
Can each java object keep track of all the threads that want to exclusively access it?
What is the difference between preemptive scheduling and time slicing?
What is sortedmap in java?
What are some examples of variable costs?
What is parameter example?