When we have wrapper classes, why are primitives supported?

We have wrapper classes in java such as Interger, Float .. why does it still support primitives that stop java to be a fully object oriented language?

+5
source share
3 answers

Packers, being objects, are put in a heap. Primitives are simply “values” and go on the stack. This is more efficient because for wrapped primitives in the heap you need (at least) both the value (which is on the stack) and the reference to the wrapper object.

, , , . , , 99% , . -, ; . , - , , , ( , ).

+6

.

+3

: .

, , , .

JVM .

+2
source

All Articles