This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Pointers" Watch "Pointers" New topic
Author

Pointers

Bill Downs
Greenhorn

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.
Thanks!
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


42
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
SCJP, MCDBA
Dirk Schreckmann
Sheriff

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]
 
 
subject: Pointers
 
Similar Threads
No function pointers unless wrapped in object?
Why Java ?
Why Pointers Are Not Required In Java?
Object location in RAM
java