Solution:
A , C, D, E and F are correct. This may look like laurel and hardy are battling to cause theother to sleep() or wait()—but that's not the case. Since sleep() is a static method, it affects thecurrent thread, which is laurel (even though the method is invoked using a reference to hardy).That's misleading but perfectly legal, and the Thread laurel is able to sleep with no exception,printing A and C (after a 1-second delay). Meanwhile hardy tries to call laurel.wait()—but hardyhas not synchronized on laurel, so calling laurel.wait() immediately causes anIllegalThreadStateException, and so hardy prints D, E, and F. Although the order of the output issomewhat indeterminate (we have no way of knowing whether A is printed before D, forexample) it is guaranteed that A, C, D, E, and F will all be printed in some order, eventually—soG is incorrect.
B, G and H are incorrect based on the above
© examsnet.com