object vs instance

Submitted 3 years, 10 months ago
Ticket #31
Views 260
Language/Framework Django
Priority Urgent
Status Closed

what is difference between object and instance? any one give me some clarification with exampke. 

Submitted on Jun 25, 20
add a comment

2 Answers

Hi Manu, Here after , I would suggest , Kindly dont create urgent ticket, unless its really necessary. Techions will guide you on this.

Submitted 3 years, 10 months ago

okay interview point of view i rise urgent ticket.

- manupanduworld 3 years, 10 months ago

object and instance are often mistaken to mean the same thing, people use them pretty much interchangeably. Definition - An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object. It boils down to _object is generic whereas instance is specific_ Example - Consider mobile. It has **n** number of features like RAM, battery, screen size etc. We can have multiple mobiles with same or different features, but all the mobiles will have **n** number of features. This common/generic thing is **object** i.e. every mobile has features. Instance is specific feature associated with it for example, Mobile-A will have 2GB RAM, 4000mah battery and Mobile-B will have 4GB RAM, 3700mah battery. These mobiles are different which we call as **instance** but drives same parameters(features) called as **object**.

Submitted 3 years, 10 months ago

Thanks Kaushik. Glad to see as a Techion member to help others.

- Vengat 3 years, 10 months ago

Thanks for the response. i need some more clarity in programming. consider this example: class A: pass obj = A()

In this example obj is object. instance is address of obj? or else?

- manupanduworld 3 years, 10 months ago


Latest Blogs