Code: class InstanceTest { public static void main(String [] args) { InstanceTest ob1=new InstanceTest(); Object ob2=ob1; System.out.println(ob2 instanceof Object); System.out.println(ob2 instanceof InstanceTest); } } I am using jdk1.6 I read this question on a site which tells it's output to be true true But when i tried it on my computer it generated error!!! can u tell why it happend so,and how to solve it.