Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Everything is a pointer in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Everything is a pointer in Java" Watch "Everything is a pointer in Java" New topic

Everything is a pointer in Java

vicky bawge
Ranch Hand

Joined: Sep 04, 2001
Posts: 34
Everything is a pointer (reference) in java including the basic data types.
e.g even you can call getClass() for int.
Any objections.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Uhhh... well, I think if you actually try it, you'll have a hard time getting int.getClass() to compile. There is a way to do something like this, but I think it will distract you from the main point - primitive types are not classes, or references, or pointers.

"I'm not back." - Bill Harding, Twister
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Becareful!!! DO NOT let Roseanne hear you say that!!!
You will hear the detailed definition of how references in Java can not be dereferenced etc and therefore are NOT pointers.
Perhaps you should join into this conversation.
Ahhhh - I see that you already have.
[This message has been edited by Cindy Glass (edited October 24, 2001).]

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Everything is a pointer in Java
It's not a secret anymore!