This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes pointers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "pointers" Watch "pointers" New topic


bharat bhasin

Joined: Jul 19, 2009
Posts: 19
how are references in java different from pointers in c and c++.
Henry Wong

Joined: Sep 28, 2004
Posts: 18507

You can't do pointer arithmetic is Java. All you can do, with a Java reference, is dereference it. So, tricks in C, such as calculating a memory location in an array or structure, to be treated as something else, won't work.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
jQuery in Action, 2nd edition
subject: pointers
Similar Threads
difference between pointer and reference
Why Java ?
Java in data structures and linked list
basic difference between c++ and java
lambda probe shows unproportial number of sesssions