Java IO Serialization
© examsiri.com
Question : 15 of 17
Marks:
+1,
-0
Given:
What is the result? (Choose all that apply.)
import java.io.*;
class Keyboard { }
public class Computer implements Serializable {
  private Keyboard k = new Keyboard();
  public static void main(String[] args) {
   Computer c = new Computer();
   c.storeIt(c);
  }
  void storeIt(Computer c) {
   try {
    ObjectOutputStream os = new ObjectOutputStream(
    new FileOutputStream("myFile"));
    os.writeObject(c);
    os.close();
    System.out.println("done");
   } catch (Exception x) {System.out.println("exc"); }
  }
}What is the result? (Choose all that apply.)
Go to Question: