Classes
A class is an extended concept similar to structures and the class
describes both properties (data) and behaviors (functions) of objects i.e.
class consists of data members and member functions.
Class is not an object but is an instantiate of an object.
Class is a blue print for an object which defines the functionality of an
object.
,
, Declaring Objects:
A class declaration only builds the structure i.e., blue print of an object.
The declaration of objects is same as declaration of variables of basic data types.
Defining objects of class data type is known as class instantiation.
Only when objects are created, memory is allocated to them.
name_of_the_class object1, object2,object3;
Ex. int x,y,z; // Declaration of integer variables
char a,b,c; // Declaration of character variables
employee a,b, *c; // Declaration of object or class type variables
, An object is an abstract unit with the following properties:
1. It is individual.
2. It points to a thing, either physical or logical that is identifiable by the
user.
3. It holds data as well as operation method that handle data.
4. Its scope is limited to the block in which it is defined.
A class is an extended concept similar to structures and the class
describes both properties (data) and behaviors (functions) of objects i.e.
class consists of data members and member functions.
Class is not an object but is an instantiate of an object.
Class is a blue print for an object which defines the functionality of an
object.
,
, Declaring Objects:
A class declaration only builds the structure i.e., blue print of an object.
The declaration of objects is same as declaration of variables of basic data types.
Defining objects of class data type is known as class instantiation.
Only when objects are created, memory is allocated to them.
name_of_the_class object1, object2,object3;
Ex. int x,y,z; // Declaration of integer variables
char a,b,c; // Declaration of character variables
employee a,b, *c; // Declaration of object or class type variables
, An object is an abstract unit with the following properties:
1. It is individual.
2. It points to a thing, either physical or logical that is identifiable by the
user.
3. It holds data as well as operation method that handle data.
4. Its scope is limited to the block in which it is defined.