当前位置:SCJP程序员认证考试题库

问题:

[单选]

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.

简述汉语的特点。 氧化锆上的粘接剂熔化,裂口或由铂电极引出线脱落等造成漏气时应怎样处理? 大庆国税局“小金库”8000万元的主要表现形式包括财政拨款和利息收入。 桥梁静载试验测定应变的仪器主要有() ①机电百分表 ②电阻应变计 ③振弦式传感器 ④静态应变仪 ①②③④。 ②③④。 ①③④。 ①②③。 临川四梦

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

参考答案:

  参考解析

本题暂无解析

在线 客服