Technical Discussion :: C++

7. What is the difference between an object and a class?

Answer:

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, and after 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 particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
Ø An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.

Asked In :: iGate Accenture

Post Your Answer Here:

Name *
Email
Alert me

Post Your Reply Here:

Report Error

Please Login First Click Here

Manish Joshi1 day ago

what if there would be cement in the option as  well..... What would be the answer and explaination???????????????

|| Reply
ankur yadav1 month ago

explaination nhi dena tha to show explanation ka option hi kyo diya

7 |6 | Reply
ayushi solanki1 month ago I

b

8 |3 | Reply
Shivangi Raj1 month ago

answer should be a

5 |8 | Reply