对StringBuffer中获取特性有点疑惑,我写了一段代码是获取长度的,不知道可不可这样
class StringBuffer
{
public static void main(String[] args)
{
method_get();
}
public static void sop(Object obj)
{
System.out.println(obj);
}
public static void method_get()
{
StringBuffer sb =new StringBuffer("abcdef");
sop(sb.length());
}
} |
|