This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Refrence variable or object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Refrence variable or object" Watch "Refrence variable or object" New topic

Refrence variable or object

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir in the following code like
Button b=new Button();
what can we say b as b is a rfrence variable or b is an object of class Button. and if it is a refrence variable then where is object.
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
b is reference to a object of type button.Button object is stored on heap.
Aum Tao
Ranch Hand

Joined: Feb 14, 2006
Posts: 210
Also, objects dont have a name. Therefore, we can't access them directly.
We use references to access the objects.

SCJP 1.4 85%
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Thanks sir
wood burning stoves
subject: Refrence variable or object
jQuery in Action, 3rd edition