alternatively you could use a scanner object to read from the file and use the function of parseInt to convert from string to integer and use the value for calculations.
i.e
Scanner inFile = new Scanner(new FileReader("filename"));
String x = inFile.next();
int x2 = Integer.parseInt(x);
then int sqr = Math.pow(x2,2); //this is just an example of a calculation you can do after converting
Note: read more on the Scanner class API and Integer to understand what i just wrote.
hope its easier to understand and helps you.
good luck