嘿,这是我的代码:
if(repeat)
{
Guesses++;
String Input = JOptionPane.showInputDialog("Enter a number between 0 and 10. So far you have had " + Guesses + " guesses.");
Float.parseFloat(Input);
if(**Input > RandomNum**)
{
JOptionPane.showMessageDialog(null, "Too small.");
}
else if(if(repeat)
{
Guesses++;
String Input = JOptionPane.showInputDialog("Enter a number between 0 and 10. So far you have had " + Guesses + " guesses.");
Float.parseFloat(Input);
if(Input > RandomNum)
{
JOptionPane.showMessageDialog(null, "Too small.");
}
else if(Input = RandomNum)
{)
(这只是其中的一部分)带有 ** 的文本是我得到错误的地方。它说
- 运算符 > 未定义参数类型 String、float
虽然我(认为)我将输入更改为浮点数(Float.parseFloat(Input);) 所以你知道问题是什么吗?(如果这已经回答了,那么你能给我一个链接吗?)