Jamie Lokier wrote:
> Agree about the memory management, but the idea that people are
> happier because "it doesn't use pointers" *still* puzzles me.
>
> Nearly every value in Java is pointer!
>
> Nearly every variable holds a pointer to an object!
>
> C code which makes heavy use of pointers looks a lot like... Java!
Key differences:
- you can't do arithmetic on references in Java
- there is bounds checking on array accesses in Java
- there is no */& syntax in Java
Java references are much more comparable to C++ references with the
proviso that C++ references can't be null. That's why I suggest to people
using C++ to use references instead of pointers where possible (guaranteed
to be non-null, no array indexing, no extra syntax).
--
Hubert Matthews http://www.oxyware.com/
Software Consultant hubert@oxyware.com