Java IO Serialization

© examsiri.com
Question : 11 of 17
 
Marks: +1, -0
Given:
1. public class Foo implements java.io.Serializable {
2.   private int x;
3.   public int getX() { return x; }
4.  publicFoo(int x){this.x=x; }
5.   private void writeObject( ObjectOutputStream s)
6.   throws IOException {
7.    /* insert code here*/
8.   }
9. }

Which code fragment, inserted at line 7, will allow Foo objects to becorrectly serialized and deserialized?
Go to Question: