1. Default Constructor is also called as no
2. This constructor has no arguments in it.
1. A constructor that can take arguments are
called parameterized constructors.
2. A parameterized constructor is just one that
has parameters specified in it.
3. We can pass the arguments to constructor
function when object are created.
1. Copy Constructor is used to declare and initialize
an object from another object.
2. For example the statement:
would define the object c2 and at the same time
initialize it to the value of c1.
3.The process of initializing through a copy
constructor is known as copy initialization.
"Hiding the Unnecessary“
Encapsulation is hiding the
For example in the image the professor do not need
to know how a student does her assignment. He is
more interested in the end product.
"Modeling the Similarity"
Similarities often exist in the world. As shown in
image above, one could easily see that there are
some similarities between the two President of
United States, George H.W Bush (41st President) and
George W. Bush (43rd President) George W. Bush is a son of George H.W Bush. He
inherits biological features from his father, at the same time, has his own unique
feature that one could identify him as George W. Bush.
This bring us to the idea of inheritance that models a “is a” relationship
"Same Function different behavior"
The word “Polymorphism” comes from two Greek
words, “many” and “form”.
We can illustrate the idea of polymorphism easily using the
scenario where different animals are asked to “speak”. As
you can see from the image above, each animal has their
own way of “speaking”.
This illustrates the power of polymorphism where different
instances can be treated the same way.