可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Assuming that the seri


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.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、Given that the current

Given that the current directory is empty, and that the user has read and write privilege...

2、You discover that the&

You discover that the schema changes that were recently made to your SQL Server 2005 datab...

3、Assuming the tag libr

Assuming the tag library in the exhibit is imported with the prefix forum, which custom t...

4、Given that the element

Given that the elements of a PriorityQueue are ordered according to natural ordering, and: Wh...

5、What would the amps be at 240 volts wi

What would the amps be at 240 volts with an 8 ohm resistance?()A32~5 ampsB25 ampsC1~5 ampsD30 am

6、Given that the element

Given that the elements of a PriorityQueue are ordered according to natural ordering,and:What is&e...