返回StringBuffer当前容纳字符的个数,StringBuffer b=new StringBuffer(10);
System.out.println(b.capacity());
结果为10。