Performance and design difference between an object and a primitive

By | July 12, 2018
Questions:

I feel like most of languages tends to justify that they are object oriented with statement like “Everything is an object” like ruby and dart.

On the other hand statement like this (Java Complete Reference)

The primitive types represent single values—not complex objects.
Although Java is otherwise completely object-oriented, the primitive
types are not. They are analogous to the simple types found in most
other non–object-oriented languages. The reason for this is
efficiency. Making the primitive types into objects would have
degraded performance too much.

So why does other languages implement primitives as objects?

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *