I have to make a program at which i have to read something from a file using FileReader.
I write here the fragment of the code which reads an integer from the file :
try { FileReader fr = new FileReader("C:\\Users\\nikipiulitza\\Desktop\\matrice.txt"); System.out.println(fr.read()); fr.close(); } catch(Exception e ) { System.out.println(e); }
In the matrice.txt file i have only written
And it reads 50 instead of 2....why ? Do i have to make another kind of files if i want to read integers from a file as they are written there ? .txt is not good ?2