How to read double in java from a file
问题 I'm trying to read a double from a file but I have this exception: java.util.InputMismatchException. I've tried to do the useLocale(Locale.US) but it doesn't work. This is my code public static void main(String[] args){ System.out.println("Introduce the name of the file"); Scanner teclat = new Scanner(System.in); teclat.useLocale(Locale.US); Scanner fitxer = new Scanner(new File(teclat.nextLine())); while(fitxer.hasNext()){ String origen=fitxer.next(); String desti=fitxer.next(); double