I have made a simple program that has a 2D String array storing lots of data. I have searched a lot of places for how to store and retrieve 2D arrays. I want to save the dat
You should be using FileOutputStream instead. FileWriter in character while ObjectOutputStream is binary output stream.
public static void main(String[] args) {
try {
ObjectOutputStream toFile = new ObjectOutputStream(new FileOutputStream("//home//user//array.DATA"));
toFile.writeObject(args);
toFile.close();
} catch (Exception e) {
e.printStackTrace();
}
}