You are not logged in.

#1 2015-06-10 10:57:14

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Java Result:

Question:
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?

Option A):
out
Option B):
done
Option C):
compile error
Option D):
One object is serialized

Correct Answer is Option A):
out


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-06-10 10:57:14

Advertisement
Ads By Google

Re: Java Result:



Board footer