Constructor Overloading
Constructor Overloading Proclaiming numerous constructors with changing number of contentions or kinds of contentions is known as constructor over-burdening. All the over-burden constructors will have a similar name as that of the class. Following project exhibits constructor over-burdening: Constructor Overloading in C++ #include <iostream> utilizing namespace sexually transmitted disease; class Student { private: string name; string regdno; int age; string branch; public: Understudy() { cout<<"Default understudy constructor is invoked"<<endl; } Student(int age) { cout<<"Student constructor with one boundary is invoked"<<endl; } Student(string n, string reg, int a, string br) { cout<<"Student constructor with four boundaries is invoked"<<endl; } }; int primary() { Understudy s1; Understudy s2(20); Understudy s3("Mahesh", "501", 20, ...