COMP 274 Week 7 Homework Assignment Recent
COMP 274 Week 7 Homework Assignment NEW
1. What types of objects can be stored using theObjectOutputStream? 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?
2. If you serialize two objects of the same type, will they take the same amount of space? If not, give an example
3. 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?
4. Can you write an array to an ObjectOutputStream?
5. Is it true that DataInputStream/DataOutputStream can always be replaced by ObjectInputStream/ObjectOutputStream?
6. What will happen when you attempt to run the following code?