can you program for reverse string?

Answer Posted / indumathi

public class StringReverseExample {

public static void main(String[] args)
{
String string=args[0];
String reverse = new StringBuffer
(string).reverse().toString();
System.out.println("\nString before
reverse:"+string);
System.out.println("String after
reverse:"+reverse);
}


}

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does sprintf return?

594


Why Java is not pure Object Oriented language?

653


How does sublist works in java?

544


Can we use both this () and super () in a constructor?

556


What is a dot notation?

554






What is the main use of java?

578


What are implicit objects in java?

554


What is the purpose of static keyword in java?

519


What is the impact of declaring a method as final?

566


Which java collection does not allow null?

717


How do you end a program?

554


When should you make a function static?

547


Give the difference between the println method and sqrt method?

629


What are desktop procedures?

565


Explain the difference between hashmap and hashtable in java?

492