System.out.println(d instanceof Cat);
That doesn't compile because the println method doesn't accept a boolean.
Try:

System.out.println((d instanceof Cat)+"");