I do not understand why I am getting a warning with the following code:
public static boolean isAssignableFrom(Class clazz, Object o) { return clazz.isAssignableFrom(o.getClass()); }
An unverified call to isAssignableFrom(Class<?>) As an element of the original java.lang.Class type
When I use the isInstance method isInstance (which gives identical results from what I understand), I don't get the warning:
public static boolean isAssignableFrom(Class clazz, Object o) { return clazz.isInstance(o); }
source share