What is the difference between Object and Instance?

Questions by ykirankumarmca

Showing Answers 1 - 6 of 6 Answers

Hi this is Ravi shankar

Instance : It is a amount memory allocated to a perticular class at the time of loading the class into JVM at Runtime.

Object : It is a variable declared for that perticular class and it holds reference (address) to the Instance of that class

minli

  • Apr 9th, 2006
 

An instance of a user-defined type (i.e., a class) is called an object. We can instantiate many objects from one class.

An object is an instance or occurence of a class.

  Was this answer useful?  Yes

Raviprakash Batni

  • Apr 22nd, 2006
 

Hi,

I din't understand this point very clearly.

Can you please explain me in a clear way.

Regards

/Batni

  Was this answer useful?  Yes

Deebendu

  • May 5th, 2006
 

Object and instance are same. you can say --Object is an instance of a class.

  Was this answer useful?  Yes

Priya Pise

  • May 10th, 2006
 

Hi Ravi Shankar !

I m not agree with u completely so can u plz enlight on the Instance again ..

  Was this answer useful?  Yes

An object is an instance of a class.

Suppose that class name is myclass

 class myclass{-----}

When this myclass is called in main

main()

{ myclass cplus;  

/cplus is an object of the class myclass/

/This process is called instatiate an object./

}

           

  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