How do i fix the issue of user input printing on the next line
from my code bellow i find that the input for vehicle make and model
prints on a separate line how can i avoid this. I have attached a copy of
the output also
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();
OutPut
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
No comments:
Post a Comment