我在java中遇到问题。它在我的开关功能中找不到符号。 我认为char inputChar(i)有问题,但我无法弄清楚问题所在。Java开关找不到符号错误
下面是代码:
import eip.*;
public class IntDigitAutomat
{
public static boolean digitCheck(char inputChar)
{
boolean isdigit = true;
int q = 1;
for (int i=0; i<input.length(); i++)
{
if(isdigit == false)
break;
switch(q)
{
case 1:
switch(inputChar(i))
{
case '+':
case '-':
isdigit = true;
q=2;
break;
case ' ':
isdigit = true;
q=1;
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
isdigit = true;
q=3;
break;
default:
isdigit = false;
}
case 2:
switch(inputChar(i))
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
isdigit = true;
q=3;
break;
default:
isdigit = false;
}
case 3:
switch(inputChar(i))
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
isdigit = true;
break;
default:
isdigit = false;
}
}
return isdigit;
}
}
}
我需要更多的文字。我需要更多的文字。我需要更多的文字。我需要更多的文字。
它找不到什么符号?什么是实际的错误信息? – markspace
'inputChar(i)'应该表示什么? 'inputChar'是一个单独的字符。 –
'IntDigitAutomat.java:10:错误:找不到符号 \t \t对(INT I = 0; I