When I run this code it skips the first line("Input first name:") and ask for the lastname. How do i fix this?
public static void newProduct() {
System.out.println("Input first name: ");
String fname = scan.nextLine();
System.out.println("Input last name: ");
String lname = scan.nextLine();
}
The output everytime I run this is:
Input first name: <User cannot input as this line gets skipped>
Input last name: <User can input>
Thanks in advance.