- 论坛徽章:
- 0
|
数组权且看作一个特殊的类吧,length是它的属性。
a.concat(a);,改变的并不是最初那个了。见源码
public String concat(String str) {
int otherLen = str.length();
if (otherLen == 0) {
return this;
}
char buf[] = new char[count + otherLen];
getChars(0, count, buf, 0);
str.getChars(0, otherLen, buf, count);
return new String(0, count + otherLen, buf);
}
|
你的class没有public声明。
[ 本帖最后由 kakasi 于 2008-3-25 12:21 编辑 ] |
|