Regarding the default constructor, I thought it would be a correct way of calling it since that implementation of the Person class does not allow the client of our code to create an object without passing any arguments to it. Would it be better to say "overriding the default constructor"?
Thanks to you, i really like it as an introduction for classes, you should continue doing this kind of post.
I considered can be called just param-constructor, if we explicitly add no-args-contructor can be called as a overloaded constructor. The Overrinding is not possible for constructors because the behavior strictly belongs to the class.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the tips, Gustavo.
Regarding the
default constructor
, I thought it would be a correct way of calling it since that implementation of the Personclass
does not allow the client of our code to create an object without passing any arguments to it. Would it be better to say "overriding the default constructor"?Thanks to you, i really like it as an introduction for classes, you should continue doing this kind of post.
I considered can be called just param-constructor, if we explicitly add no-args-contructor can be called as a overloaded constructor. The Overrinding is not possible for constructors because the behavior strictly belongs to the class.