what is the problem with my code and why do I have the InputMismatchException error every time I type the name in the console ?
Scanner sc = new Scanner(System.in);
System.out.println("How many People are there ? (employee and students included)");
int numPeople = sc.nextInt();
Person[] personArray = new Person[numPeople];
Student[] studentsArray = new Student[numPeople];
Employee[] employeesArray = new Employee[numPeople];
int i=0;
while(i < numPeople) {
System.out.println("Please enter the name and age of the person");
String name = sc.nextLine();
int age = sc.nextInt();sc.nextLine();
Person person = new Person(name, age);
personArray[i] = person;
i++;