6.8 OOP constructeur-1
Hello, welcome to this yard that will be dedicated to builders, we will deepen the notion of builder, first we ... let’s see what a builder is, the rules for a constructor and finally the different types of constructors that one can ... do, by definition a constructor is a special method used to initialize objects so the constructor is called when a ... object of a class creates, a class can have several constructors with different parameters it can also be used to ... initialize the values of the attributes of an object It should be known that the creation of a constructor is almost the same as a method, ...but there are differences a builder does not have a return type not even a void in builder ... has the same name as the class see example with the challenge we did. In our challenge, we ... did not put a builder, but afterwards we will see manufacturers by defects and also the ... different types of builders, but we will create a builder to show you the example to make a consult, you have to make ... public so because the other classes have to have public access and the name of the class here ... the name of the SimpleCalculaator class and then you have to put the parentheses and open the braces. Now, that I ... showed you how to create a builder, you have to know that every time an instance is created, the builder is ... called. The last difference between a builder and a method and the fact that we did not declare a builder in ... final, static or abstract, these are new terms, but in the rest of the course, I’ll explain it to you As ... I said in the example we did to create a builder in our challenge all classes have ... a default builder during the creation of a class in Java you already have a default builder And that’s ... what default builder that allowed us to create an object during our challenge since we didn’t have ... a builder. Then the constructors with parameters that allow us to initialize the values of the attributes of an object and ... to finish the constructors his argument Now that we have finished with the theory in the next course we will ... make practice we will create default constructors with parameters and constructors without arguments ... so that you can understand and at the end of this course that we will do you will perform a ... challenge that will allow us to take the set of all we’ve learned isto say the creation of class ... the getter the setter and to finish the builders to soon