Skip to content

Latest commit

 

History

History
8 lines (4 loc) · 410 Bytes

what-is-stored-in-variable.md

File metadata and controls

8 lines (4 loc) · 410 Bytes

What is stored in a variable?

You can consider a variable as a container, which can contains a value.

For a variable of primitive type, the value in the container is the exact value that variable represents.

For a variable that represent an object, the value stored in the container is actually the memory address of that object. In this case, we say the container just stores a reference to the object.