Answer Posted / narayanan
public class reverse {
public static void main(String args[]){
String s="malayalam";
StringBuffer sb=new StringBuffer();
int k=s.length();
for (int i = k-1; i >-1; i--) {
sb.append(s.charAt(i));
}
System.out.println(sb);
}
}
Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What is a superclass?
What do you understand by weak reference?
What is immutable in java?
What is difference between an object and a class?
Explain what access modifiers can be used for methods?
Explain purpose of sleep() method in java?
Can we access instance variables within static methods ?
What is the difference between a synchronized method and a synchronized block?
What are the main uses of the super keyword?
What is overloading and overriding in java?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
How many functional interfaces does java 8 have?
What is the functionality of the stub?
Why are there no global variables in java?
Which class cannot be a subclass in java?