Wednesday, February 23, 2022

Explaining an constructor - java

Explain an cosntructor, or an constructor is a method, or the cosntructor is like the method, be an method or be like is like be son(is a method) or be brother(is like a method),
so what is between parentensis --> () is what gonna be informed by the typest, so is the parameters the parameters is what will gonna be typed for the user, yuo don't mess, when I was in classroom I was thinking that was in the method what have inside already and not what is inputed by the user, so it will be used to after the equal-sign --> = what means tha sentence--> this.nome = no; 'this' is that I need say that when the program being running, this is what replace the object instanciaded, before instacied I don't know the name of the object, because if I already knew the name of the object what shit of program that work with only one predefinied object, with 'this' gonna work for any future object and for infinite number of objects. and 'no' is an information that was inserted by the user (is no because I choice that way in the parantesis could be nome or even nothing appeared with it is because is cleaner the ideas have relation with the other by names that remit to the other) and now I am using to give that value for my parameter nome (name).
Using that construction x=y, is important who is at left and who is at the right, the 'x' to be at the left will receive the value of 'y', see I could have x with the value 5 and the y with the value 7,(does work if one is int and the other is String? an place that have an int could receive an String?), so this way the two gonna value 7, the 'x' gonna lost its previous value to have the value of 'y', 'x' and 'y' are varibles and they have values that are int integer, and the value now for the two are 7. Now of course that we write to be the most academic possible so for us have the sequency, so y==x is the same that x==y, you think that for a computer ask 7 is equal to 5? is different that 5 is equal to 7? Computers when deals with this academics and philosophal persecution using the mathematical logic simplify and considere the same. Rute Bezerra de Menezes Gondim

No comments:

Post a Comment