试题详情
单项选择题 10. public class Foo implements java.io.Serializable {  11. private int x;  12. public int getX() { return x; }  12.publicFoo(int x){this.x=x; }  13. private void writeObject( ObjectOutputStream s)  14. throws IOException {  15. // insert code here  16. }  17. }  Which code fragment, inserted at line 15, will allow Foo objects to be correctly serialized and deserialized?() 

A、 s.writeInt(x);

B、 s.serialize(x);

C、 s.writeObject(x);

D、 s.defaultWriteObject();

  • D
  • 关注下方微信公众号,在线模考后查看

热门试题