My problem right now is: In my text file I get some funky looking characters when trying to use ObjectOutputStream to write my object to my cases.txt file.
FileOutputStream file = new FileOutputStream("/cases.txt");
ObjectOutputStream data = new ObjectOutputStream(file);
DefectProduct s1 = new DefectProduct("test", 5, "test", "test",
"test", 50, 2019, 1, 24, "505", "test" );
data.writeObject(s1);
data.flush();
data.close();
System.out.println("Record added");
For now I'm trying to get the part of writing my object to a textfile to work. I read somewhere that ObjectOutputStream was the choice for writing objects to text files. Is this correct?
In the end my goal is to take a whole arraylist of objects and write the whole arraylist to my text file at once.