Tuesday 2 September 2014

Object Oriented Programming Structure


OOPS


C++ is  considered as more secure and efficient language because it works on the concept of accessing the information which is important at that time and ignoring the rest of the information.
C++ has various common features as compared to C and it has some advance features which are very important for the better used of any technology.Now come on the Basic Concept of OOPS.

Basic Concepts of Object Oriented Programming
1.Objects
2.Classes
3.Data Abstraction
4.Data Encapsulation
5.Inheritance
6.Polymorphism
7.Dynamic Binding
8.Message Passing

OBJECTS
 
An object is the real time entity with the help of which data of the class get accessed.
we create object by writing
classname  objectname;


CLASS

Class contains information of similar type or a class contains variables and methods.A class can be declared with the help of keyword class and class always get termninated by(;).
skeletion of the class

Class ClassName
{


variables
+
methods


};


Data Abstraction
It means we need to focus only on the essential part of the information and ignore the rest of the information.

i.e. Suppose we have 5 functions in a class but we have to use only three functions of this class so, we will use concept of Data Abstraction.


Data Encapsulation

The wrapping up of data and functions into a single unit is known as encapsulation.It  gives the concept of data hiding.
We have three access specifiers.
  1. public-It can be accessed outside the class.
  2. private-It cannot be accesses outside the class.
  3. protected-It can be accessed outside the class but only in derived class.

Inheritance

It gives the concept of reusability of the code defined inside the class.By mean we can add additional features to an existing class without modifying it.
  1. Multilevel
  2. Mulltiple
  3. Multipath
  4. Hybrid
  After we will more discuss on these points.
 
Polymorphism
 
Poly means many morphism means forms.When you are performing multiple tasks with one name
then the whole concept is known as polymorphism.
In polymorphism we study two concept-
  1. Function Overloading
  2. Function Overriding
 
Dynamic Binding
 
Binding refers to a linking of a procedure call to the code to be executed in response to the call.Dynamic Binding also knows as late binding means that the code associated with a given procedure call is not known until the time of call at run-time.It is associated with polymorphism
and inheritance.
 
Message Passing
 
An object-oriented program consists of a set of objects that communicate with each other.The
process of programming in an object-oriented language,therefore ,involves the following basic
steps:
  1. Creating classes that defines objects and their behaviour .
  2. Creating objects from class definitions
  3. Establishing communication among objects.
 

 

No comments:

Post a Comment