我的代码如下:
} else if (words.toUpperCase().equals(words)) {
for (int i = 0; words.length() > i; i++){
thisLetter = words.charAt(i);
letter = thisLetter.isLetter();
if (!letter){
break;
}
}
letter 是布尔值,thisLetter 是 Character 类型(不是 char)。由于某种原因,我在编译时收到以下错误:
no suitable method found for isLetter()
method java.lang.Character.isLetter(int) is not applicable
(actual and formal argument lists differ in length)
method java.lang.Character.isLetter(char) is not applicable
(actual and formal argument lists differ in length)