当在未进入正确的选择它不显示重新进入或重复循环while循环没有瓶坯else语句和重复循环
int counterA = 0;
while (counterA < 0) {
if (conversionSelection.equalsIgnoreCase("binary"))
counterA++;
if (conversionSelection.equalsIgnoreCase("octal"))
counterA++;
else System.out.println("Error. Please enter weither to convert the Hex to Octal or Binary:");
conversionSelection = keyboard.nextLine();
}
谢谢......我原来写的代码有其他if语句,但一直写为“如果别人”并且不可能搞清楚为什么它不工作。 – jscincy1 2014-10-17 00:17:02