Primitives Vs Objects

The major difference between primitives and Objects is that variables containing primitives hold the data inside of the variable itself.

In case of objects, this is not the case. Variable associated with objects, do not actually contain the object but instead they contain reference to a place in memory where the object is stored.

Let’s have a look at this practically

For Primitives

For Objects

Let’s have a look in case of functions

About the author

Deepak Sood

Deepak Sood is Lead Consultant in an IT firm holding expertise in Devops and QA Architecture with 8 years of experience.

His expertise is in building highly scalable frameworks. His skills include Java, Configuration Management, Containers, and Kubernetes.

Reach out to him using contact form.

View all posts