试题详情
- 单项选择题 Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Java serialization and given: import java.io.*; class Food implemertts Serializable {int good = 3;} class Fruit externds Food {int juice = 5;} public class Banana extends Fruit { int yellow = 4; public static void main(String [] args) { Banana b = new Banana(); Banana b2 = new Banana(); b.serializeBanana(b); // assume correct serialization b2 = b.deserializeBanana(); // assume correct System.out.println(”restore “+b2.yellow+ b2.juice+b2.good); } // more Banana methods go here } What is the result?()
A、 restore 400
B、 restore 403
C、 restore 453
D、 Compilation fails.
E、 An exception is thrown at runtime.
- C
关注下方微信公众号,在线模考后查看
热门试题
- Which two̳
- Which statemen
- 定义枚举如下: publi
- public c
- A class
- 举例说明getter和setter方法的
- Which layout
- Which two̳
- 百钱百鸡问题 用100钱买1
- 什么是最终类,如何定义最终类?试列举最终
- 以下关于Java文件名的叙述,正确的有?
- public static&
- 1. import&ensp
- 建立一个银行账户类,要求能够存放用户的账
- 求四位的水仙花数。即满足这样条样的四位数
- - list 是一
- public class&e
- Java数据库连接库JDBC用到哪种设计
- 局部内部类可以访问final局部变量
- 一般情况下,以下哪个选项不是关系数据模型