I'm doing this program but I always jump to error even if you enter the correct parameter, do you know why it can be?
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package estructuresderepeticio;
/**
*
* @author carlos
*/
import java.util.Scanner;
public class JudoNew3 {
public static void main(String[] args) {
Scanner Scan = new Scanner(System.in);
Double pes;
boolean pesReal = false;
System.out.println("digam el pes: ");
pesReal = Scan.hasNextDouble();
if (pesReal) {
pesReal = false;
pes = Scan.nextDouble();
if (pes > 25 && pes < 65) {
System.out.println("Peso registrado. ");
pesReal = true;
} else {
System.out.println("El niño esta fuera del peso permitido ");
}
} else {
System.out.println(" Peso incorrecto, introduzca un numero real");
}
}
}