The only way you can do this check is if you have the Class
object representing the type:
Class<T> type; //maybe passed into the method
if ( type.isInstance(obj) ) {
//...
}
The only way you can do this check is if you have the Class
object representing the type:
Class<T> type; //maybe passed into the method
if ( type.isInstance(obj) ) {
//...
}