Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Everything is a pointer in Java

 
vicky bawge
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything is a pointer (reference) in java including the basic data types.
e.g even you can call getClass() for int.
Any objections.
-Vivek
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic