What is the difference between an object and a class?
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.
RE: What is the difference between an object and a class?
Classes and Objects: Classes are explained focusing on member data and methods as well as access control. Constructors and destructors are introduced and the difference between interface and implementation is emphasized.
OBJECTS: Objects are the basic building concepts of oops.Objects are the basic runtime entities in an object oriented sysyem...In other words data and function which combine into a single entity is called object.CLASS: A class combine data(called data members)and functions(called member functions)Class is a logical framework that defines the relationship between it's members and act as a templatefor creating it's variable called objects.
Class is a userdefined datatype with data members and member functions which can be public or privately accessed depending on access specifiers.
Objects are instances of classes which identifies the class propeties.A particular class can have it's own class which makes it identifying it's object.
-A Class is a blueprint of an object or we can say that its a template of an object. -Objects are memebers of a class. -A class decribes all the attributes of object.