Java-3 online test, online practice test, exam, quiz

Online Practice Test > Java-3        (Total 22 questions)        (Time spent 0:0)

1. class test { }

public class test1 implements Serializable
{
private test k = new test();

public static void main(String[] args)
{
test1 c = new test1 ();
c.store(c);
}

void store (test1 c)
{
try {
ObjectOutputStream os = new ObjectOutputStream(
new FileOutputStream("myFile"));
os.writeObject(c);
os.close();
System.out.println("done");
}
catch (Exception x)
{
System.out.println("out");
}
}

}

What would be the result?




   View Answer and Discussion
Advertisement