hi folks.
uhm how do i read all the inputs from a file, well the problem is it only reads the first line? can you help me, im not yet familiar with the methods thanks
Here's the main class
import java.util.*; import java.io.*; public class readFile { public static void main(String[]args) throws IOException { Scanner sc = new Scanner(new FileReader("cool.in")); int min = Integer.parseInt(sc.next()); int max = Integer.parseInt(sc.next()); System.out.println(min+" "+max); } }
and here's the "cool.in" file to be read
1 10 20 30 40 50 60 70