试题详情
- 单项选择题 1. import java.io.*; 2. public class Foo implements Serializable { 3. public int x, y; 4. public Foo( int x, int y) { this.x = x; this.y = y; } 5. 6. private void writeObject( ObjectOutputStream s) 7. throws IOException { 8. s.writeInt(x); s.writeInt(y) 9. } 10. 11. private void readObject( ObjectInputStream s) 12. throws IOException, ClassNotFoundException { 13. 14. // insert code here 15. 16. } 17. } Which code, inserted at line 14, will allow this class to correctly serialize and deserialize?()
A、 s.defaultReadObject();
B、 this = s.defaultReadObject();
C、 y = s.readInt(); x = s.readInt();
D、 x = s.readInt(); y = s.readInt();
- D
关注下方微信公众号,在线模考后查看
热门试题
- 1. import&ensp
- When usingQ
- 程序: class&ens
- 以下关于异常捕获的原则中,错误的是()
- 11. public&ens
- public class&e
- package test; class
- 下面关于依赖注入(DI)的说法不正确的是
- Which the two&
- Which code,&ens
- 数组元素怎样进行缺省的初始化?
- You want
- class Order&en
- Which two&ensp
- public class&e
- 鼠标监听器有哪些特点?()
- 已知: 则下面的说明哪些是正确的()
- 子类可以继承父类的除私有成员以外的其它所
- Swing允许你选择程序的图形界面风格,
- 线程由以下哪些部分组成?()