package inout; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class BufferedReaderFrmFile { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new FileReader("F:\\nu.txt")); List<Integer> numbers = new ArrayList<Integer>(); String line = null; while ((line = br.readLine()) != null) { String []strNumbers = line.split(" "); for(String strNumber : strNumbers){ numbers.add(Integer.parseInt(strNumber)); } } br.close(); Collections.sort(numbers); System.out.println(numbers); } }
java.lang.NumberFormatEsception: For input string: ""
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)