wood burning stoves 2.0*
The moose likes Java in General and the fly likes Instance and Reference variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Instance and Reference variables" Watch "Instance and Reference variables" New topic

Instance and Reference variables

Vallabhaneni Suresh Kumar
Ranch Hand

Joined: Mar 01, 2004
Posts: 68
What is the difference between instance variable and reference variable?

Thank you
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

They're overlapping things -- you can't divide all variables into one or the other category.

Instance variables are non-static members variables of a class. Reference variables are non-primitive variables -- i.e., all variables of class or interface type.

[Jess in Action][AskingGoodQuestions]
It is sorta covered in the JavaRanch Style Guide.
subject: Instance and Reference variables