欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

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.

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题