else if(digit == 2)
{
System.out.print("Enter the name of artist : ");
String artist=input.nextLine();
System.out.print("Enter the song title : ");
String song = input.nextLine();
System.out.print("Enter the number of week :");
int oldWeek =input.nextInt();
System.out.print("Enter the new number of week :");
int newWeek =input.nextInt()
}
Здравствуйте, Я бегу иначе, если цикл, где, если пользователь вводит 2 следующий код будет работать, но проблема здесь, кажется, что, когда он работает он работает 2 System.out.println
код вместе. Вот пример моего выходавход Пользователь не работает
This program will display singles that was Number one on charts
Enter 1 or 2. 2
Enter the name of artist : Enter the song title :
u необходимо опубликовать все соответствующие части кода. –
«он работает, он запускает 2 кода System.otu.println вместе» - Как? – Maroun
Возможный дубликат [Пропуск nextLine() после использования nextInt()] (http://stackoverflow.com/questions/13102045/skipping-nextline-after-use-nextint)? – PakkuDon