Friday, April 29, 2011

A View On C++

C++ is the first OOPs(Object Oriented Programming Language) which was introduced in the Programming world to make the Programming system more easy and understandable.

Object Oriented Programming is an approach to program organization and development that attempts to eliminate some of the pitfalls of conventional programming(C language).

Anyways lets go with some of the concepts of OOPs.
1) Class.
2)Object.
3)Data Abstraction and Encapsulation.
4)Inheritance.
5)Polymorphism
6)Dynamic Binding
7)Message Passing

All the concepts defined above contribute a lot to the object oriented paradigm.
Now lets explain each of the concept in detail..

1.)Class: Class is a reference type or a user defined datatype which refers to a memory location and consists of functions(C++)/methods(JAVA) and data members which are packed inside like a tiffin box :) ...A real time example of a class is just a class in your college where madam/sir are methods and students are data members who act accordingly to the method calls.

2.)Object:Object is an instance of a class(standard definition in any text book :) )...But many of us are confused with this definition...As said earlier Classes contain data members and methods...and we have said that classes are just reference types..Then you may get a doubt that how is memory allocated to this class and how are these data members are manipulated?
Instance is nothing but Space (or) memory.So object can now be defined as "memory allocated for a class" is an object..With the help of this object we are going to manipulate the data members present inside the class.

3.)DataAbstraction and Data Encapsulation: Abstraction refers to the act of representing essential features without including the background details or explanation..In many programs we can see that business logics contain many variables and values assigned to those variables.So after the end of the program a user can only view the UserInterface runnig in different Stages..
But user doest know how that process is implemented..A desktop application is implemented in c++ then when we run that software it only shows the output how we have implemented.But not the code that is written in the back-end.

Data encapsulation works through access specifiers like
Private
Public
Protected
Lets go with these access specifiers in the next tutorial...

SEE YA :)