从下面的代码中,我发现车辆制造商和型号的输入打印在单独的行上,我该如何避免这种情况。我还附上了输出的副本
System.out.print("Enter Hire Length (in days):");
int hLength = Integer.parseInt(input.nextLine());
System.out.println("Enter Vehicle Make and Model:");
makeMod = input.nextLine();
System.out.print("Enter Vehicle registration No:");
regNum = input.nextLine();
输出
Enter Hire Length (in days):9
Enter Vehicle Make and Model: <<< this is where the Issue is Mazda 3 should be after here
Mazda 3 <<< Not here
Enter Vehicle registration No:YJZ 561