jQuery in Action, 3rd edition
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
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
I agree. Here's the link: http://aspose.com/file-tools
subject: Refrence variable or object
It's not a secret anymore!