hi,
Can anybody tell me why compiler is flashing error for the following code.
Error Msg "inconvertible types"
Actually it should print "no"
class Tree{
public void tell(){
System.out.println("tree");
}
}
public class Pine{
public static void main(String[] args){
Pine p=new Pine();
if (p instanceof Tree){
System.out.println("yes");
}else{
System.out.println("no");
}
}
}
Regards
Prasad
------------------
Can anybody tell me why compiler is flashing error for the following code.
Error Msg "inconvertible types"
Actually it should print "no"
class Tree{
public void tell(){
System.out.println("tree");
}
}
public class Pine{
public static void main(String[] args){
Pine p=new Pine();
if (p instanceof Tree){
System.out.println("yes");
}else{
System.out.println("no");
}
}
}
Regards
Prasad
------------------