Computer Science, asked by Chintoo2709, 1 year ago

Give 3 differences between primitive and reference data type.

Answers

Answered by priyashiju
27
The main difference between primitive and reference type is that primitive type always has a value, it can never be null but reference type can be null, which denotes the absence of value. 

primitive types store actual values but reference type stores handle to object in the heap

Reference variables are not pointers but a handle to the object which is created in heap memory


Answered by Anonymous
56
Primitive data type:
1. These are the data types provided by java
2. The size is fixed
3. To create a variable of primitive type 'new' keyword is not used

Reference data type:
1. These are the data types created by a programmer
2. The size depends on the number of member variables and their types
3. To create a variable of reference type 'new' keyword is used.



Similar questions