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 a real beginers question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "a real beginers question" Watch "a real beginers question" New topic

a real beginers question

Surya Renduchintala

Joined: May 01, 2001
Posts: 10
hey folks!
how does java handle pointers. i know that java as such does nt have pointers but it creates the references and objects right. i am totally confused on these references can some one help me in explainin me.
thanks in advance ......
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
Hi Surya,
A really good starting place is at The Campfire's Story Pass-by-value Please.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Basically all variables of type Object are actually pointers to an Object.
So with
String s = "Java";
s is actualy a pointer pointing to the location of the String.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
AHA Thomas!! Caught ya!
You KNOW that it says in the fine print of the JLS
Thou shalt NOT use the word pointer as a synonym for a reference in JAVA.
Even though a variable holds an address or reference to the location of an object in java, it does not have the same ability to be manipulated the way a pointer in c does. Therefore it is dangerous to use the word pointer in any context in java.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: a real beginers question
It's not a secret anymore!