问题 I have MyClass and I want to call both mySubMethod(key) and mySubMethod2(key) for integer, but only call mySubMethod2(key) for non-integer. I tried below codes but doesn't work. I also tried to change K == int to something else, e.g. K == Integer , K.equals(int) and K.equals(Integer) etc., but all of them don't work. How Can I fix it? Thanks. public class MyClass<K,V> { public boolean myMethod(K key) { if (K == int) { mySubMethod(key); }else { // do nothing } mySubMethod2(key); return false;