for (int i = 0; i < fields.length; i++)
{
for (int j = 0; j < fields[i].length; j++)
{
if (fields[i][j].getText().length() == 0) //IF ZERO OR NOT A NUMBER
{
JOptionPane.showMessageDialog(null, "Answers missing");
return;
}
answers[i][j] = Integer.parseInt(fields[i][j].getText());
}
}
我如何断言用户将输入一个数字(非零)?是否可以使用 OR 运算符 (||) 将其添加到 if 语句中?