I'd like to get a better understanding of the isAssignableFrom behaviour in Java between primitive and reference types.
Eg:
System.out.println(boolean.class.isAssignableFrom(Boolean.class)); // false
System.out.println(Boolean.class.isAssignableFrom(boolean.class)); // false
boolean primitive;
Boolean referenceType = true;
primitive = referenceType;
System.out.println(primitive); // true
I know that when assigning primitives <-> reference that boxing / unboxing occurs as required, but I'd have thought that therefore isAssignableFrom would return true in the first two examples above.
Could someone please explain why it returns false, and what the appropriate test here is?