what is the difference of “class instance” and “object”?
-
An object is an instance of a class.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.
-
WangZHua wrote:
“class instance”
? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
An object is an instance of a class.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.
-
WangZHua wrote:
why does rational rose has two concepts
Rational Rose is one of the most irrational pieces of software I have ever tried.
-
Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.
What language are you trying to disect. An object is a lump of data that can be managed by a single handle, by whatever means, either by knowing th precice interpretation of the object, or by knowing how to handle it from the 'outside', and accessing it because you know it's type. A Class is a CPP construct, it is a Prototype, or blueprint of a cpp object. an Instance (of a class or type) is an actual variable of the type, and as such, an object. All cpp instances are objects, Not every object is a CPP class instance. If you understand the underlying ideas, the distinction becomes trivial, and at the same time futile! :)
Bram van Kampen
-
I can't speak of another's opinion. Perhaps you should ask them.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch