题目内容

Assuming that the serializeBanana2() and the deserializeBanana2() methods will correctly use Java serialization and given: import java.io.*; class Food {Food() { System.out.print(”1”); } } class Fruit extends Food implements Serializable { Fruit() { System.out.print(”2”); } } public class Banana2 extends Fruit { int size = 42; public static void main(String [] args) { Banana2 b = new Banana2(); b.serializeBanana2(b); // assume correct serialization b = b.deserializeBanana2(b); // assume correct System.out.println(” restored “+ b.size + “ “); } // more Banana2 methods } What is the result?()

A. Compilation fails.
B. 1 restored 42
C. 12 restored 42
D. 121 restored 42
E. 1212 restored 42
F. An exception is thrown at runtime.

查看答案
更多问题

同时拥有相对的两种兴趣类型的情况怎么办?

压缩机活塞上除装有活塞环外,还有()

我国现存最大、保存最完好的哥特式建筑是()。

A. 北京西什库教堂
B. 上海徐家汇教堂
C. 天津老西开教堂
D. 广州圣心大教堂

流行音乐也需要汲取民族音乐文化的养分,这样才能走得更远。

A. 正确
B. 错误

答案查题题库