I would like to know how to create my own exception to control that the notes only have the rank of 1 to 10, that if it is not fulfilled skip a message
Code:
System.out.println("Introduca fecha de nacimiento");
do{
System.out.print("Dia(1-31): ");
objFecha.setDia(tecla.nextInt());
System.out.print("Mes(1-12): ");
objFecha.setMes(tecla.nextInt());
System.out.print("Año(1980-1999): ");
objFecha.setAnio(tecla.nextInt());
if(objFecha.fechaCorrecta()==false)
{
System.out.println("\nFecha de nacimento incorrecta, introduzca de nuevo");
}
}while(objFecha.fechaCorrecta()==false);