欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

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();

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题