An abstract class is a class which contains atleast one
abstract method(i.e., an abstract method is one which has
only definition not implementation,which is done in some
We cannot create an object for Abstract class.
A class is said to be a concrete class if and only if it
contains fully defined methods.Defined methods are also
known has "concrete methods " or "Implemented methods".
We can instantiate an object for concrete class.
First of all, we should understand what is the meaning
of 'abstract' in terms of software. It's the same meaning
as in English, that is, the entities (objects) which do not
exist in the real world are abstract entities. For example,
Dog, Cat, Bear, Deer are all animals that exist but animal
is also an entity which is just a concept and there is no
So we can define an abstract class for 'Animal'. We can
derive any number of real world animal classes from the
abstract class 'Animal' like Tiger, Lion, Donkey, etc.
Obviously, we can understand now why we cannot create
objects for abstract classes. The answer is we must not,
Because the Animal class has no existance in real world. So
we cannot create a real world entity (nothing but an
object). That is the very reason this concept is followed.
The derived classes that we've seen above are concrete
classes since they are real world objects and have definite
properties and operations on them.
5. Write c++ function that would intake a string and return
the number of occurrences of a given character in that sring
Ex:- if the word is “Colombo” and count the occurrences of
the letter “o” the function would return 3