What is the difference between instance and object?

Questions by venkateshwar

Showing Answers 1 - 10 of 10 Answers

Pardeep Singh

  • Nov 3rd, 2006
 

When we create object from a class, it is created on stack or on heap. The existance of an object in memory (stack or heap) is called instance of an object.

Hence Instance and object is used interchangeably.

wael.salman

  • Jul 16th, 2008
 

A class is an Abstract Datatype which, when instantiated, sets aside memory which holds data in fields and references to the instructions for methods.

An instance of a Class is a section of heap memory set aside, using the class's template, to hold particular data and references back to the shared class instructions stored in the Stack. We access the start of that memory area by using the name of the instance. The runtime engine has calculated the offset from that location to go to the memory location where the individual data or method references are stored.

  Was this answer useful?  Yes

adeelqamar8

  • Sep 12th, 2008
 

When you create a custom type (class) in any language, that class in OOP is called Object and when you create an istance of this class just as we create instance of built-in types e.g. (int a,float b) it is called instance of the object.

  Was this answer useful?  Yes

Suppose there are number of classes and their objects whenever we call a particular object at run time then memory is allocated to that particular object and that is called Instance.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions