Keep the rocks out of your array and you can avoid instanceof . Or have rocks do nothing when ordered to speak. This is the idea behind the null object pattern.
Keep the rocks out of your array and you can avoid instanceof . Or have rocks do nothing when ordered to speak. This is the idea behind the null object pattern.