else if(input==5){
String artist = "Bob";
System.out.print("Artist: ");
artist = keyboard.nextLine();
Playlist artistList = defaultPlaylist.getSongsByArtist(artist);
artistList.printAllSongs();
}
当我运行它时,它完全跳过 [artist = keyboard.nextLine();]
键盘是扫描仪对象的一个实例。
编辑 - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------------------------------- ------------------------------------- “跳过”是指完全忽略。当我运行它时,它不要求用户输入。