As the code is written, you can't. animalType is local to that method. Once you leave that method it is gone forever. You would need to save it off somewhere in a variable that won't disappear on the method exit.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors