Even after lots of trial and error, I am unable to figure out how to write a java program that adds 2 integers (read from a text file) and displays addition result on the console.
I tried using FileInputStream, DataInputStream classes ...
Example explaining what I exactly need !
Suppose there are 2 integers stored in a text file (sample.txt) .... Let 1 and 2 be the integers.
I would like to read those integers from the file and display their sum (= 3) on the console
Any help would be appreciated !
P.S: I am a beginner in Java, so please be as simple as you can wrt coding !