Use a BufferedReader -Reads a character at a time from a FileReader -Assembles the characters into a line and returns it
Use Integer.parseInt or Integer.parseDouble to convert the
strings to numbers
Code
FileReader reader = new FileReader ("input.txt");
BufferedReader in = new BufferedReader(reader);
String inputLine = in.ReadLine();
double x = Double.parseDouble(inputLine);