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 java applet? What is an interface?
What is a variable and constant?
Is java same as core java?
Explain the scope or life time of class variables or static variables?
What is the difference between an array and an array list?
Write a code to show a static variable?
What is the basic concept of java?
What is mnemonic in assembly language?
What is gui programming?
Can a static member function access member variable of an object?
What is the default access specifier for variables and methods of a class?
Explain the importance of finally over return statement?
What are the restrictions imposed by a Security Manager on Applets?.
What are the changes in java.io in java 8 ?
How big is a boolean?