10. Comparing primitive and objects

Difference between primitive type and object type

Primitive Type Object Type
immutable value mutable value
stored as value itself stored as reference value (memory address of an object)
Pass by value Pass by reference
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×