If a programmer defines a class and defines a default value parameterized constructor inside it. He has not defined any default constructor. And then he try to create the object without passing arguments, which among the following will be correct?
If a programmer defines a class and defines a default value parameterized constructor inside it. He has not defined any default constructor. And then he try to create the object without passing arguments, which among the following will be correct? Correct Answer It will create the object (as the default arguments are passed)
It will create the object without any problem, because the default arguments use the default value if no value is passed. Hence it is equal to default constructor with zero parameters. But it will not create the object if signature doesn’t match.
মোঃ আরিফুল ইসলাম
Feb 20, 2025