COMP 274 Week 7 Homework Assignment
- What types of objects can be stored using the ObjectOutputStream? What is the method for writing an object? What is the method for reading an object? What is the return type of the method that reads an object from ObjectInputStream?
- If you serialize two objects of the same type, will they take the same amount of space? If not, give an example
- Is it true that any instance of java.io.Serializable can be successfully serialized? Are the static variables in an object serialized? How do you mark an instance variable not to be serialized?
- Can you write an array to an ObjectOutputStream?
- Is it true that DataInputStream/DataOutputStream can always be replaced by ObjectInputStream/ObjectOutputStream?
- What will happen when you attempt to run the following code?