instance of a class

Discussions

Web tier: servlets, JSP, Web frameworks: instance of a class

  1. instance of a class (1 messages)

    what is the difference between refernce an instance of a class.can u provide me some clear exemples.

    Threaded Messages (1)

  2. instance of a class[ Go to top ]

    Reference variables holds memory location where the object has been created. When we destroy an object, actually we destroy the reference so as the object iteself.

    Customer cust = new Customer();
    Here, cust is an object reference variable (which points to the memory location where the Customer instance is created). So, a Customer instance is created and the reference is stored in the reference variable.