3
I know it is a question of beginner, but I need to remedy this doubt. I searched through the internet and not always the sites enter in "agreement".
Every class must have a builder ?
Example:
I can do the student class and have no constructor and the methods register (name, age, rm) and this method is responsible for providing the values for the class properties (name, age, rm) and the method disable(id_student).
In my view this is more practical at the time of instantiating the class. If it is just disable the student just called desativar()
.
Because if you do the constructor receiving class properties every time you access some method of it I will have to pass all values (name, age, rm), even if only desativar()
.
I’m thinking wrong? what’s the best practice?
I was so big to answer, I even forgot to check if I already had the answer. I have to agree that it is the same question, practically
– Wallace Maxters