Answer the question
In order to leave comments, you need to log in
How to write an integer to a text file?
I am programming in Java. I cannot write the value of a variable of type Int to a text file. I used the DataOutputStream class in which I nested the FileOutputStream
DataOutputStream writer = new DataOutputStream(new FileOutputStream("D:\\Eclipse\\workspace\\MyExperimentalProject\\files\\output.txt"));
writer.writeInt(a);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question