Someone kindly clear my doubt on memory management in Java with the below-mentioned scenario.
When we assign value for the primitive data type variable the value will be stored in stack memory. Please do correct me if I understood the concept wrong.
As same like how the memory will allocate when do assign a value of a non-primitive data type as mentioned below.
Integer a = 3;
Will create a memory in stack or heap?