Classes and objects are separate but related concepts. Every object
belongs to a
class and every class contains one or more related objects.
- A Class is static. All of the attributes of a class are fixed before, during,
the execution of a program. The attributes of a class don't change.
- The class to which an object belongs is also (usually) static. If a
belongs to a certain class at the time that it is created then it almost
still belong to that class right up until the time that it is destroyed.
- An destroyed. Also during that lifetime, the attributes of the object may
undergo significant change.
Object on the other hand has a limited lifespan. Objects are created and
eventually Suppose that data is an array of 1000 integers. .