移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

单选题

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

发布日期:2021-05-15

Assuming that the serializeBanana() and the deseri...
A

restore 400

B

restore 403

C

restore 453

D

Compilation fails.

E

An exception is thrown at runtime.

标签: "暂无标签"

题王网让考试变得更简单

扫码关注题王,更多免费功能准备上线!