Object vs. instance [duplicate]

2019-05-31 15:41发布

问题:

Possible Duplicate:
What is the difference between an Instance and an Object?

What is the specific difference between an object and an instance?

回答1:

An object is an instance of a class.

When you instantiate a class, the result is an object of the class type.



回答2:

In short, 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 this article: Class vs Object vs Instance



标签: oop