Home > Back-end >  What is the difference between the constructor and the general function?
What is the difference between the constructor and the general function?

Time:10-01

1: two different function definition format,
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 object

CodePudding user response:

reference 1st floor qybao response:
or lack of precondition, average function is also divided into static and non-static, static don't need to create objects

Posting this is marketing, report
  • Related