中国Java开发网 - sPara.length()和sPara.length有什么区别?

来源:百度文库 编辑:神马文学网 时间:2024/04/29 08:46:07
public boolean isNumber(String sPara){
int iPLength = sPara.length();
for(int i=0;ichar cTemp = sPara.charAt(i);
boolean bTemp = false;
for(int j=0;jif(cTemp==cNum[j]){
bTemp = true;
break;
}
}
if(!bTemp) return false;
}
return true;
}
看了这段程序,忽然在想sPara.length()和sPara.length有什么区别?
另外谁能解释一下这段程序?感谢!
in sPara.length(), length() is a method of the String class
in cNum.length, length is an attribute of the array cNum (a special class that has unique syntax)