From time to time you might want to know the data type of a parameter passed to method in a Java generic class. For example, imagine that you wish to write a method to identify whether a String or an Integer was received as an argument. You could accomplish this task using the instanceof operator. To learn how to use the instanceof operator with a Java generic class, follow these four steps.

Leave a Reply

Your email address will not be published. Required fields are marked *