• Post Reply Bookmark Topic Watch Topic
  • New Topic

help me  RSS feed

 
vikash dwivedi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
can u plz tell me ,what is difference between object and reference variable in java language.
thax in advance
vikas
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reference variable is any variable that we declare in java code. whereas object has some more deeper meaning in the sense it has actual physical existence in the memory.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amol Fuke:
Reference variable is any variable that we declare in java code.


Only variables that refer to objects are references; boolean, byte, char, short, int, long, float and double are called "primitives" and they're not references.

A reference is like a leash, a handle, or a remote control: their only purpose is to let you hang on to, manipulate, or control some object. See here for a nice friendly explanation, with pictures.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!