File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Pointers" Watch "Pointers" New topic


Bill Downs

Joined: Apr 26, 2004
Posts: 1
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.
Jeffrey Hunter
Ranch Hand

Joined: Apr 16, 2004
Posts: 305
There are no explicit pointers in Java, so you won't find any syntax involving the (*).
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
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 ]

Mike Gershman
SCJP 1.4, SCWCD in process
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
There is of course the NullPointer, most well known as the NullPointerException

Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
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 ]

Francis Siu
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
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.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Pointers
It's not a secret anymore!