Tuesday, March 10, 2015

Java String Buffer set Length in pgm



Java String Buffer setLength

public class JavaStringBufferSetLengthExample
{
public static void main(String[] args)
{
StringBuffer sbf = new StringBuffer("StringBuffer setLength method example");
sbf.setLength(12);
System.out.println("StringBuffer contents: " + sbf);
sbf.setLength(0);
System.out.println("StringBuffer contents deleted:" + sbf);
   }
}

No comments:

Post a Comment