10/12/2020 (Mon) 03:49:31
Sir, I need to write desginated code on serialization:https://www.geeksforgeeks.org/serialization-in-java/
My understanding is we create for output object:>FileOutputStream file = new FileOutputStream("filename.ser"); >ObjectOutputStream out = new ObjectOutputStream(file);
Then for each object:
If the object is a Subject:
Subject WNK101 = new Subject("WNK101", "Wanking Fundamentals: The Dog", 6);
Subject WNK102 = new Subject("WNK102", "Wanking Fundamentals: Advanced Techniques", 6);
Do we then do?
Could we have where we new the object inside?
out.writeObject(new Subject("WNK101", "Wanking Fundamentals: The Dog", 6));
out.writeObject(new Subject("WNK102", "Wanking Fundamentals: Advanced Techniques", 6);
We are trying to make an object that represents a Course of Subject and Major. Perhaps I can make the Course object with the structure then directly output it without all the extra fuss. The idea is that we then import this object and use it as part of the program.