D and F. D is correct because the wait() method is overloaded to accept a wait duration
in milliseconds. If the thread has not been notified by the time the wait duration has elapsed,
then the thread will move back to runnable even without having been notified. F is
correct because wait()/notify()/notifyAll() must all be called from within
a synchronized, context. A thread must own the lock on the object its invoking
wait()/notify()/notifyAll() on.
A is incorrect because wait()/notify() will not prevent deadlock. B is incorrect
because a sleeping thread will return to runnable when it wakes up, but it might not necessarily
resume execution right away. To resume executing, the newly awakened thread must still be
moved from runnable to running by the scheduler. C is incorrect because synchronization prevents
two or more threads from accessing the same object. E is incorrect because notify() is not
overloaded to accept a duration. G and H are incorrect because wait() and sleep() both
declare a checked exception (InterruptedException).
how is this statement evaluated?I know this topic has been discussed earlier.I'd try to search it.Can anybody provide me with the link for this solution.I would really appreciate if someone could help me with this.3>>>-3
a. return 31;
b. return getI1();
c. return getI2();
d. return getI1() + getI2();
e. return 31 * getI1() + getI2();
f. None of the above
So when you add 0.5 to round(-3.2) you intuitively think you should get -3.7 but you really get -2.7 and the answer will be -2. Confusing! And it'll be on the test!