Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pointers

 
Bill Downs
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just beginning to use java, as I have an AP test in it soon. I was tasked with finding out if there were anything similiar to C++'s pointers in java. I believe that so far, I've found there aren't. Any help here would really be appreciated.
Thanks!
 
Jeffrey Hunter
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are no explicit pointers in Java, so you won't find any syntax involving the (*).
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java references are much closer to C++ references.
For instance, you can't do arithmetic with Java references other than == .equals() instanceof
I think if you compare them in your textbooks, you'll find other similarities.
[ April 26, 2004: Message edited by: Mike Gershman ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is of course the NullPointer, most well known as the NullPointerException
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ar.. yes
C++ similar to Java
Java contains object reference when you create the object that using varible point to the created object
Such as
HelloWorld hw =new HelloWorld();
hw is the object reference
And linked list similar to C++ structure.
It may be wrong, It may be better if Bartenders or sheriffs explain

[ April 26, 2004: Message edited by: siu chung man ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Bill!
As you're learning to understand references (and variables) in Java, I recommend spending a few minutes reading a couple of the JavaRanch Campfire Stories - especially the "Cup Size" and "Pass-by-Value Please" stories.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic