OBJECT and INSTANCE

What Is The Difference Between Object and Instance?

Questions by srikar.kumar

Showing Answers 1 - 6 of 6 Answers

If you declare a variable inside the class is called an instance of the
variable inside class.


Class A{ int x;// instance of the variable};


You can access the same variable/instance though the object of the same
class.


Class A
{
int x;
float y;
char c; }
obj;
class a::void func()
{
obj.x;
obj.y;
obj.c;
}


So object is an instance of a class, which allocates the memory for that
instance. If no memory allocated then object is not created.

  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