What is parameterized constructor? Give an example.
Parameterized Constructor: We know that when we create an object the constructor function gets execution automatically. Consider the following lines of codes, constructor(){ //this is the constructor function a=1; //initializing }void main(){ constructor ob1,ob2; } When this executed the value of ‘a’ for both ob1 and ob2 sets to 1. But when we want different … Read more