2: the constructor is created, the object is called, is used to initialize, initialization and action executed only once,
General function, the object is created, you need to call to perform, can be called multiple times,
CodePudding user response:
Or lack of precondition, general function also have static and non-static, static don't need to create the objectCodePudding user response: