Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA "pointer "?

 
Frank Zheng
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bruce Eckel has a good aticle about comparing C++ and java in his book("Think in Java"). However, when he talk about the pointer, his word is really ambique. Can anybody give any insight about the "Pointer" issue in Java.
" The Java promoter initially said "No Pointer", ...then they say " Restricted Pointer".
Thanks,
Frank
 
Deepak Mahbubani
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Zheng:
Bruce Eckel has a good aticle about comparing C++ and java in his book("Think in Java"). However, when he talk about the pointer, his word is really ambique. Can anybody give any insight about the "Pointer" issue in Java.
" The Java promoter initially said "No Pointer", ...then they say " Restricted Pointer".
Thanks,
Frank

Java DOES have pointers. In fact they are called references in the Java Language Specification.
"An object is a class instance or an array.
The reference values (often just references) are pointers to these objects, and a special null reference, which refers to no object." JSL - 4.3.1

The Java promoter initially said "No Pointer" because Java pointers are different from the conventional C , C++ pointers in the sense that they give restricted capabilities. For instance, u can't add, or subract to a pointer. THis is because memory management is done by the JVM itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic