This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes refrence,instance and object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "refrence,instance and object" Watch "refrence,instance and object" New topic
Author

refrence,instance and object

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir i often get confuse the diffrence between refrence,instance and object of a class so please specify the difrence between these things.


with regfard


Arun kumar maalik
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Hi

My name is not sir but i will reply

When a class is instantiated and loaded it becomes an object.

When you have many objects of the same type they can be called as instances of that object. They need not have the same data in them.

A reference is used to point to an object. This reference may also point to null which means that it points to nothing. A reference is a way by which you can access the contents of that object. If you try to execute methods or access variables of a reference that points to null, you get a NullPointerException.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refrence,instance and object
 
Similar Threads
Understanding superclass and subclass objects
Doubt in jsp and el implicit objects
Related to Object
object Vs instance
DownCasting Generally