C++ is an extension of the C Programming Language.
A D V E R T I S E M E N T
C Programming language was been
developed in the Bells Labs in the year 1969-1973. UNIX Operating system was also been
developed at the same time.
Bjarne Stroustrup created the C++ during the year 1983 in the Bells Labs. It was designed
for the UNIX environment. It also represents the C programming enhancement and makes
programmers to improve the quality of code that has been produced, This makes the code
which can be reused easier to write
What is Inheritance?
Generally speaking, objects are been defined in terms of the classes. We know
lot about object by knowing about its class. Even if you do not know what the
penny-farthing is, if I tell you it was bicycle, you would definately know that it
has two wheels, handle bars and the pedals.
The Object-oriented systems will take this step further and will allow the classes to
be defined in terms of the other classes. For an example, a mountain bikes, race bikes
and the tandems are all a different kind of the bicycles. In an object-oriented
terminology, the mountain bikes, the race bikes and the tandems are all subclasses of
a bicycle class. Similarly, bicycle class is a superclass of the mountain bikes,
race bikes and the tandems.
Inheritance Benefits
Subclasses provides the specialized behaviours from a basis of the common elements
provided by a superclass. Through use of the inheritance, programmers can reuse a code in
superclass many times.
Programmers can implement the superclasses that will define the "generic" behaviours
(called the abstract classes). Essence of superclass is defined and can be partially be
implemented but much of the class is been left undefined and also unimplemented. Other
programmers fill in details with the specialized subclasses.
What is Multiple Inheritances?
A subclass having more than one superclass is called Multiple inheritances.
This will enables a subclass to inherit the properties of more than one super class
and to combine all these properties.
What is Polymorphism?
Different types of objects which respond distinctively to same message is called
Polymorphism, example, when we do send same message, �cost� to the spike-bicycle object,
a mono-cycle object and the tandem bicycle object, each of these object will respond
appropriately.
All these cycles of a class bicycle have their own individual price.
What is Data Abstraction?
Public interface, formed by a collections of messages understood by the object,
will define how to use this object. The programs which wants to manipulate the object,
will only have to be concerned about messages this object will understand, and need not
worry about how the tasks are achieved nor internal structure of an object.
Hiding up of the internal details makes the object abstract, and a technique is normally
known as the data abstraction.
What is Encapsulation?
Packing up an object's variables within its methods is called encapsulation.
Encapsulating the related variables and methods into neat software bundle seems simple
but is a powerful idea that provides two benefits to the software developer.