About Me

Thursday, August 15, 2013

What is OOPs?

In this semester I am studying OOPs with C++. I have already studied OOPs with C++ in my 12th standard. I wish to share whatever I understood about "What is OOPs?"

First of all, many thinks OOPs means C++. Not at all. OOPs is a concept which can also be implemented in C++. Object Oriented Programming is abbreviated as OOP. Objects are the successors of structures.

Why go for classes from structure?
In structures, we don't have much security as in classes FOA. Secondly, structures cannot give functionality to its variable whereas classes can give functionality to its objects with the help of member functions.

What does OOPs help for?
It helps us to create a virtual environment for a real world object.

To explain objects, let us take an example. A Car.A car has many functionality like applying brake, applying accelerator, applying clutch, changing gear and so on. This car can be virtualized using Classes.

How?
A class can be defined with a name car with following members.

Data MembersExample : speed,milage etc., which stores the speed of the car, milage of the car etc.,

Member Functions

For applying brake, we can define a function apply_brake

For accelerating, we can define a function accelerate

For calculating speed, we can define a function speedometer

and so on.

This is a simple example of OOPs. Hope you may be aware of the film "The Matrix." It explained about OOPs concept so deeply that, The whole world is virtualized considering, world itself as an object. A person who understands OOPs, would surely understand the film at once.