Sunday 5 January 2014

An introduction to Classes

->A class is a way to bind data and its associated functions together.
->It allows the data and functions to be hidden from external use.
->While defining a class we create a abstract data type that can be treated as built-in data type
->Generally a class specification has two parts
     1.Class declaration.
     2.Class function definition
->The class declaration defines the type and scope of it's members.
->Class function definition defines how class functions are implemented.

The general form of class declaration is:
class class_name
{
   private:
     variable declarations;
     function declarations;
   public:
     variable declarations;
     function declarations;
};
->The keyword class specifies is an abstract data of type class_name
->The keywords public,private are visibility modes.
->Data hiding(usage of private)is the key feautre of object-oriented programming. 

No comments:

Post a Comment