Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Superclass (or) class definition of Java Primitive?

Tags:

java

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?

like image 432
karthick Avatar asked Dec 26 '22 08:12

karthick


1 Answers

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

like image 188
Tash Pemhiwa Avatar answered Dec 28 '22 08:12

Tash Pemhiwa