题目内容
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?()
查看答案
搜索结果不匹配?点我反馈