Here I have a generic method which accepts a generic type parameter T
public static <T> boolean compare(T p1, T p2) {
return p1.equals(p2);
}
now if I call this method like below
compare(10, "");
it works but as I assume it shouldn't work cause it can accept only one type of Type parameter
, so how inference algorithm works here?