This code have no syntax error, but gets InputMismatchException when I put the float value. Double value instead float gets the same exception. If I enter every value in F.f format (with a dot) the exception appears. If I enter with 1,9 value (comma) this code works. Why?
Scanner l = new Scanner(System.in);
String n;
int i;
float a;
System.out.print("N: ");
n = l.nextLine();
System.out.print("I: ");
i = l.nextInt();
System.out.print("A: ");
a = l.nextFloat();
System.out.println(n);
System.out.println(i);
System.out.println(a);
Thanks in advance!