0
我對java相對陌生,並且正在爲類的項目工作。這是系統的一部分,我一直在這件作品中遇到錯誤。Java randInt開關功能問題
public class NumberTest
{
private static void main(String[] args)
{
}
static private char GenerateNumber()
{
int gennumber = 0;
while(gennumber < 3)
{
char returnChar = ' ';
switch(randInt(0,9))
{
case 0:
returnChar = '0';
break;
case 1:
returnChar = '1';
break;
case 2:
returnChar = '2';
break;
case 3:
returnChar = '3';
break;
case 4:
returnChar = '4';
break;
case 5:
returnChar = '5';
break;
case 6:
returnChar = '6';
break;
case 7:
returnChar = '7';
break;
case 8:
returnChar = '8';
break;
case 9:
returnChar = '9';
break;
default:
System.out.println("Error Random int outside expected values");
}
return returnChar;
System.out.println(GenerateNumber());
gennumber++;
}
}
}
我收到的錯誤是: Test.Again.java:12:錯誤:找不到符號 開關(randInt(0,9) 符號:方法randInt(INT,INT) 位置: 。類NumberTest