I am trying to write a for loop that will allow a user to input five names and ages. The problem I am having is that it runs right the first time but then when it runs the second time the first name and last name are combined and it is not allowing two string entries. It will allow one then move to the integer entry for age. Any help is appreciated.
import java.util.Scanner;
public class QueueImp extends people{
public static void main(String[] args) {
String userL;
String userF;
int userA;
int userchoice = 0;
Scanner scnr = new Scanner(System.in);
for(int i = 0; i<5; i++) {
System.out.print("Please enter last name: ");
userL = scnr.nextLine();
System.out.println("");
System.out.println("Please enter first name: ");
userF = scnr.nextLine();
System.out.println("Please enter age: ");
userA = scnr.nextInt();
System.out.println("");
pName(userL, userF, userA);
}