Ask a Teacher



Please give me the syntax of constructor?.

A constructor is that unit of a class which is  used to initialize  the data members.The name of the constructor is same as the class name.A constructor  automatically invoked whenever an object of the class is created.

Syntax :

             ClassName( )
             
             {

                      statements ;
             }


comments powered by Disqus