I want that when there is an error for the introduction of user data, I will ask for the data again until they are ok.
public class EntradaDeDatos {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner entrada= new Scanner(System.in);
int edad=0;
System.out.println("Introduce tu Nombre, Edad y Fecha de nacimiento");
String nombre=entrada.next();
try{
edad=entrada.nextInt();
}catch(Exception e)
{
System.out.println("Debes de escribir un numero y no una letra ");//////**aqui quiero que regrese a pedirle los datos**
}
String fechan=entrada.next();
System.out.println("Tu nombre:"+nombre+"\n Tu Edad"+edad+"\n Tu Fecha de nacimiento"+fechan);