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);
}}