public void addFriend(String name, Class type, T animal); public T callFriend(String name, Class type); Inside both methods you should check that the parameters are sane. See Effective Java and the Class javadoc for more info. edited May 17, 2016 at 16:22.More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.