Thursday, February 20, 2014

Example of StringBuffer reverse method in java.

public class StringBufferReverseMethod
{
public static void main(String surat[])
{
StringBuffer sb = new StringBuffer("Mahi CandyFry");
System.out.println("Original text: " + sb);

sb.reverse();
System.out.println("Reversed text: " + sb);
}
}

Output:



No comments:

Post a Comment