Since the primitive double is represented with the java.lang.Double class, shouldn't double.class equal java.lang.Double.class? (This of course also happens on other primitive types too)
System.out.println(double.class == Double.class);
Output:
Result: false
Double.class
is the class object corresponding to the wrapper type Double
. double
is actually not a class, but double.class
is the object used in reflection to indicate that an argument or return type has primitive type double
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With