can someone tell me why when I am typing inputDouble
(as a double of course), a conditional doesn't let me pass. I tried this also on float type and result is the same.
EDIT: Conditional passing when I'm typing integer.
public static void main(String[] args) {
Scanner inputDouble = new Scanner(System.in);
System.out.println("Double");
if(inputDouble.hasNextDouble()){
System.out.println("Passed");
}
inputDouble.close();
}
Thanks for help.
SOLVED: CODE WAS GOOD I WAS TYPING INPUT WITH DOT INSTEAD OF COMMA