can anybody give me ans with explanation
1)
String s1 = new String("amit");
System.out.println(s1.replace('m','r'));
System.out.println(s1);
String s3="arit";
String s4="arit";
String s2 = s1.replace('m','r');
System.out.println(s2==s3);
System.out.println(s3==s4);
2)
for what are all data types the value -0 is exist in their value range
3) Boolean b1 = new Boolean("TRUE");
Boolean b2 = new Boolean("true");
Boolean b3 = new Boolean("JUNK");
System.out.println("" + b1 + b2 + b3);
a) Comiler error
b) RunTime error
c)truetruefalse
d)truetruetrue
Correct answer is c)
4) i read the static method in the
thread class are to avoid the one thread to communicate with other.
but since static is a class method then how a particular thread can have it. eg:sleep
whats the significance in having the staic method in the thread class