can you program for reverse string?

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


Please Help Members By Posting Answers For Below Questions

What are the different types of sorting in java?

542


How many types of assembly languages are there?

531


What is difference between final and immutable?

565


How do you check if an arraylist is not empty?

579


Why is the singleton pattern considered to be an anti pattern?

480






What is the maximum length of a url?

515


What is assembly language?

554


What is final class?

579


Who developed java?

576


What is the implementation of destroy method in java. Is it native or java code?

492


Why we cannot override static method?

565


How would overload a function based on return type?

552


What is called module?

573


How can you traverse a linked list in java?

690


What is t in generics in java?

565