What I am trying to do is most easily explained as such:
Animal animal = petStore.getRandomAnimal();
if(animal.isDog()){
kennel.add(animal)
}
Obviously I can not do it this way since kennel.add() only accepts type Dog.
I have determined that the animal is a dog, but how do I let the compiler know this?
working in java.