Showing posts with label String buffer java. Show all posts
Showing posts with label String buffer java. Show all posts

Wednesday 9 April 2014

Reverse string using StringBuffer class

Reverse string using StringBuffer class

class InvertString
{
   public static void main(String args[])
   {
      StringBuffer a = new StringBuffer("Java programming is fun");
      System.out.println(a.reverse());
   }
}
StringBuffer class contains a method reverse which can be used to reverse or invert an object of this class.

Comment

Comment Box is loading comments...