У меня есть ошибка в петле. Оператор WHINE отображается как ошибка в Eclipse? Что мне не хватает ... (да, я знаю, что это простой код ... сначала я собираюсь начать с кода начинающего. < /P>
/**
* @author Nathan
*
*/
public class DietCokeSong {
/**
* @param args
*/
public static void main(String[] args) {
int dietCokeNum = 99;
String word = "Cans of Diet Coke";
While(dietCokeNum > 0) {
System.out.println(dietCokeNum + " " + word + " on the wall");
System.out.println(dietCokeNum + " " + word + ".");
System.out.println("Take one down.");
System.out.println("Pass it around.");
dietCokeNum = dietCokeNum - 1;
if(dietCokeNum > 0) {
System.out.println(dietCokeNum + " " + word + " on the wall");
} else {
System.out.println("No more Cans of Diet Coke on the wall.");
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/764 ... mbol-while