when the thread's run() method is called directly,it doesn't start a new thread...it ll run the existing thread... so, t1 is printed the second time also
The output of the above code is GFC206,GFC206 but,
but, executing this code results in compile time error.. i think both the methods are almost same...can somebody explain me why this difference in output?
hi friends, i m preparing for SCJP. I feel that Dan's questions are a bit tough.. the real exam also having the same tough level or is it tougher than this??
hi, i still have a doubt... when color2 is not an instanceof blue, b2 shd be assigned with false. but is it like this, The two objects having super-sub class relationship can only be compared using 'instanceof'? clear my doubt
hi friends, consider the following code, i thoght b1,b2,b3 are assigned with values true,false and false respectively, but the answer given is "compile time error".. can somebody explain me how that comes???
class Color {} class Red extends Color {} class Blue extends Color {} class A { public static void main (String[] args) { Color color1 = new Red(); Red color2 = new Red(); boolean b1 = color1 instanceof Color; boolean b2 = color1 instanceof Blue; boolean b3 = color2 instanceof Blue; System.out.print(b1+","+b2+","+b3); }}