What is the difference between Primitive and Reference types ?

Before get started to read this article, I want to warning that this article, which I write, writing by Java programming language.

When you create variable in any primitive type, java automatically assign this value to variable, you could see backgorund of this code in following picture:

When you create variable in any reference type, java automatically assign this value to object of reference type of instance variable, not to variable .This variable called value,but this value is an array. This variable name specially created by java developers! You could see backgorund of this code in following picture:

picture-3.

What happen if we write value to called word of variable. Java itself does something like this automatically. The Hello value you write is assigned by the constructor to the instance value array. You could see in following picture.

picture-4.

If you know what the constructor is and what constructor does, you will have no difficulty understanding it.

Azerbaijan Techniqual University🎓