java.lang.String里的equals()方法的源码,我看不懂,求解释!!
public boolean equals(Object anObject) {if (this == anObject) {
return true;
}
if (anObject instanceof String) {
String anotherString = (String)anObject;
int n = count;
if (n == anotherString.count) {
char v1[] = value;
char v2[] = anotherString.value;
int i = offset;
int j = anotherString.offset;
while (n-- != 0) {
if (v1[i++] != v2[j++])
return false;
}
return true;
}
}
return false;
}
上面是源码!!
int n = count;
if (n == anotherString.count)
count表示的是什么?
最好是从头到尾解释说明一下!!