+ 3
What is the difference between value type and reference type?
3 Answers
+ 5
java passes types by value not reference. meaning a copy of the original value is made and you manipulate the copy, not the original value. reference type is usually done for objects (non primitives). when manipulating reference types, the original value is changed along with every change.
hope that helps. :)
+ 1
Value types go on the stack fully. Those are the number types.
Objects are reference types. They have the useful information stored on the heap, and a reference to their heap address on the stack. Hence the name.
+ 1
Thank you guys ! i understand now.