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

问题:

[单选]

import java.io.*; 
public class Forest implements Serializable { 
private Tree tree = new Tree(); 
public static void main(String [] args) { 
Forest f= new Forest(); 
try { 
FileOutputStream fs = new FileOutputStream(”Forest.ser”); 
ObjectOutputStream os = new ObjectOutputStream(fs); 
os.writeObject(f); os.close(); 
} catch (Exception ex) { ex.printStackTrace(); } 
} 
} 
class Tree { } 
What is the result?() 

A .  Compilation fails.
B .  An exception is thrown at runtime.
C .  An instance of Forest is serialized.
D .  A instance of Forest and an instance of Tree are both serialized.

井下配电网路均应装设(). 过流,短路保护装置。 短路,过负荷保护装置。 短路,过负荷,接地和欠压释放保护。 简述解放战争后期中国共产党的文件传阅制度 需求的价格弹性等于需求曲线的斜率。 前奏曲《雨滴》是由()创作的 柴可夫斯基。 肖邦。 莫扎特。 巴托尔迪。 法国的高等教育主要与三类机构实施,分别是大学、大学校和()。

import java.io.*; 
public class Forest implements Serializable { 
private Tree tree = new Tree(); 
public static void main(String [] args) { 
Forest f= new Forest(); 
try { 
FileOutputStream fs = new FileOutputStream(”Forest.ser”); 
ObjectOutputStream os = new ObjectOutputStream(fs); 
os.writeObject(f); os.close(); 
} catch (Exception ex) { ex.printStackTrace(); } 
} 
} 
class Tree { } 
What is the result?() 

参考答案:

  参考解析

本题暂无解析

在线 客服