I have a problem after I skipped the exception about the edat
attribute.
The problem is that when I miss the error and capture it instead of asking me the next question that would be the dni
I jump directly to ask the population, that is, skip the% of dni
.
I leave the code:
System.out.printf("Introdueix la edat ");
try {
edat = pregunta.nextInt();
} catch (InputMismatchException m) {
System.err.println("Exception: " + m);
}
System.out.printf("Introdueix el dni ");
dni = pregunta.next();
System.out.printf("Introdueix la provincia ");
provincia = pregunta.next();