hi friends,
These are some of the quest from a mock exam-
Q1. Which of the following are true about the class defined inside an interface
1> it is not possible in the
java Laungage. //ans
2> The class is always public.
3> The class is always static.
4> the class methods cannot call the methods declared in the interface.
5> the class methods can call only the static methods declared in the interface.
my ans is 2.
Q2.What does the following expression return
Math.max(Float.POSITIVE_INFINITY,Double.POSITIVE_INFINITY);
1>Float.POSITIVE_INFINITY
2>Double.POSITIVE_INFINITY //ans
3>runtime Exception
when I tried this using a code , the answer comes id infinity.Does Double.POSITIVE_INFINITY and infinity mean the same.
Q3.Assume that th is an instance holding a
thread object. th.start() causes the thread to start running and eventually complete its execution. The object reference by th is not accessable any more and is garbage collected when the garbage collecter runs.
True
False //ans
Shouldn't the thread object get gced after completion of run? so the ans should be true.
Q4. can we explicitly call the constructor of an abstract class?
I'll be thankful if anyone could give the correct explanation for these.
Mamta