看不懂,請幫我英文翻中文的翻譯,和JAVA程式的說明

看不懂,請幫我英文翻中文的翻譯,和JAVA程式的說明(或只有翻譯中文或解釋JAVA程式也可以) 1. Given import java.io.*; public class forest implement Serializable{ private Tree tree = new Tree (); public static void main (String[]args){ Forest f = new Forest(); try{ FileOutputStream fs = new... show more 看不懂,請幫我英文翻中文的翻譯,和JAVA程式的說明(或只有翻譯中文或解釋JAV...
1.
Given
import java.io.*;
public class forest implement Serializable{
private Tree tree = new Tree ();
public static void main (String[]args){
Forest f = new Forest();
try{
FileOutputStream fs = new FileOutputSteam("Forest.ser");
ObjectOutputStream os = new ObjectOutoutStream(fs);
os.writeObject (f);os.close();
}carch (Exception ex){ex.printStackTrace ();}
}}

class Tree {}
Wtat is the result?
B.Anexception is thrown at runtime

2.
Click the Exhibit button
Which code,inserted at line 14,will allow this to correctly serialize and deserialize?
D.x= s.readlnt ();y=s.readlnt ();
3.
Given:
11.String test= "This is a test";
12.String [] tokens = test. split ("\s");
System.out.println (tokens. length);
What is the result?
D.Compilation fails

4.
Date date = new Date();
df.setLocale (Locale.ITALY);
String s = df.format (date);
The Variable df is an object of type DateFormat that has been initialized inline 11.
What is the result if this code is run on December 14,2000?
D.Compilation fails because of an error in line 13

5.
The doesFileExist method takes an array of directory names representing a path from the
root filesystem and a file name. The method resurns true if the file exists,false if it does not.

Place the code fragments in position to complete this method.

public static boolean doesFileExist(String[] directories, String filename) {
for ( String dir : directories ){
}
1 answer 1