I just want to know what is the difference between an object and instance with example.
3 Answers
An object is a software bundle of related state and behavior. A class is a blueprint or prototype from which objects are created. An instance is a single and unique unit of a class.
read more :Class vs Object vs Instance

- 175,020
- 35
- 237
- 263
Often the words instance and object are synonyms. Read more about objects
Some languages (e.g. Smalltalk, Common Lisp, and even MELT) are reifying their classes, by having classes instances of meta-classes. In that case, you might say that these class objects are not instance (but it is a matter of terminology and context).
In other languages (e.g. C++) classes are not objects, e.g. because they make only sense at compile-time.
Some object oriented languages (e.g. JavaScript or Self) don't have classes but prototypes.

- 223,805
- 18
- 296
- 547
As has been already mentioned, a class is a blueprint/recipe for creating objects. Hence,
- A class is a blueprint for creating objects of that class.
- On the reverse side, an object is an instance of that class.
"Object" is a runtime concept, it exists while running. That is when, for example in Java, when the program execution reaches a statement where is says
ClassA objA = new ClassA();
it is then that an object of that class is created, or instantiated. In the above code, objA is an instance of ClassA.

- 3,365
- 1
- 19
- 19