Home > Back-end >  Questions about the class
Questions about the class

Time:09-17

For members of the class assignment in the class initialization, and use what is the difference between constructor initializes, what benefits, or the latter

CodePudding user response:

Constructor assignment, can guarantee is performed and must perform only once!
For example, some parameters need to initialize only once, at the back of the values may change at any time, but it must be an initial value and that fits in the constructor,
On the other place, may be called multiple times,

CodePudding user response:

The constructor with high efficiency to
  • Related