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 are heap memory and stack memory and what are memory tables.
What is an object’s lock and which object’s have locks?
What is identifier give example?
Explain differences between collection api and stream api?
What do you mean by garbage collection used in java?
Does list maintain insertion order java?
Why do I need to declare the type of a variable in java?
What is the benefit of singleton pattern?
What are the different types of inner classes?
How java enabled high performance?
What are the main uses of the super keyword?
What is the purpose of object oriented programming?
Explain about doubly linked list
List some features of the abstract class.
What is main difference between variable and constant?