I was looking at my notes the other day and realized I still don’t fully understand the difference between an object, class, and instance.
From what I know:
- An object is a thing … much more than this and I don’t know how to define an object. An object is a function, variable, etc. right?
- A class is a way of encapsulating (or is it abstraction?) code to make it more simple to use. All the objects inside the class can be of varying types and lengths and are, by default, private.
- I know that in C++ an instance and an object are the same. But I also read that when use a class it creates an instance of the class than can be treated as an object. What does this all mean?
Could anyone explain it and offer an example?
Thanks in advance.