+ 10
Is reference types in JAVA are works as pointers in C ?
2 Answers
+ 2
Well kinda
In fact in Java as in C, all objects are stored as references in variable. The difference is that Java manage them himself, so you don't have to.
The consequences are that your code is easier to write as you don't have to bother with them, but on the other side you've got less (to no) control over how the memory is handled as it's Java and it's garbage collector who's in charge of freeing memory, unlike C where you do it yourself.
One is more efficient when it comes to memory, the other is easier to write/understand
+ 1
Its all