If Object is superclass of everything, then why does it treat primitives different? Is there any class that is predefined for int, float...(data types)? What is the superclass or where is the class definition for primitives?
There is no class definition for Java primitives. There are, however, convenience classes that act as sort of wrappers around primitives, e.g. Integer
and Double
. But even these derive from Object
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