Friday, March 6, 2015

Java StringBuffer setLength in pgm



Java StringBuffer 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