0
How can write and read arraylist to a file?
how can write data to a file and read data from that? which format of file better to use to make file protected? make an simple example please.
6 Réponses
+ 1
I think this should help you:
https://code.sololearn.com/cyN739LetgkU/#java
What do you mean by "make the file protected"?
0
protected: dont editable
0
Your question is how to read/write a file from/to an ArrayList. This is already answered.
"Read-Only" for your application or for any user (which is easy to be changed by user anyway)?
You can play arround with:
File f = new File(sFile);
f.setExecutable(false);
f.setReadable(false);
f.setWritable(false);
0
think we have an arraylist, we want save data to that, and read this data from this arraylist, how write this code?
0
This i already answered down below with a sample program
0
There are a lot of stream types you can try, there is a lot of information on the web. I recommend inStream and outStram. Just make sure you know how to use them well as they can make a lot of errors when used not correctly. If you need help detecting those errors you try using some softwares such as checkmarx or others.
Anyway, good luck with it!
Ben.