The chosen thread will run until one of the following conditions is true:
A higher priority thread becomes runnable.
It yields, or its run method exits.
On systems that support time-slicing, its time allotment has expired.
Then the second thread is given a chance to run, and so on, until the interpreter exits.
Which of the following statements are true?
(Select two correct answers)
A:
For any i < 0, Double.isNaN(Math.sqrt(i) will return true;<br /> B:<br /> Math.random()*100 > 0.0 will never return false;
C:
For any a > 0, Math.ceil(a) >= 1 will always return true;
D:
You can not change the length of an array after you defined it.
Answers:
: A C
Explanation:
: The range for random() is 0.0(inclusive)
to 1.0(exclusive).
Once an array is created and instantiated,
you cannot modify its length.
So u r saying that null can be used in place of an Object in equals()? How so, if AFAIK null isn't an Object? I am confused. Please clarify
The reason why s1.equals(s2) when s2 is null is the following:
the equals method in the class String will accept an Object parameter. You pass on null and this is ok.