Silly OOP question about constructors
I am learning OOP and came across this. A way to reuse constructors:
I was wondering that can I just use default values for parameters like this, to achieve same result:
If yes then is their any use case when we would prefer the 1st way over 2nd?
I was wondering that can I just use default values for parameters like this, to achieve same result:
If yes then is their any use case when we would prefer the 1st way over 2nd?
