package pack10;
class StringBufferDemo10
{
public static void main(String[] args)
{
show();
}
public static void show()
{
StringBuffer sb=new StringBuffer();
sb.append("Auvtdfjpewhkj");
char[] arr=new char[9];
sb.getChars(2,8,arr,2);
for(int x=0;x<arr.length;x++)
{
System.out.println("arr["+x+"]="+arr[x]+";");
}
}
}
输出为:
,数组的第一、二、八个元素怎么会等于a,不是空的吗? |
|