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 is polymorphism java example?

776


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

833


What is comparator in java?

755


Can we use catch statement for checked exceptions?

761


What is a class component?

874


What is module in oop?

783


What is the purpose of encapsulation?

754


State some advantages of java?

1001


What does three dots mean in java?

880


What does i ++ mean in Java?

724


How does a for loop work java?

789


How do you create a reference in java?

716


How do you declare a variable?

851


Explain differences between collection api and stream api?

860


Can we define a package statement after the import statement in java?

831