Home > Back-end >  Why didn't the method parameters and return value type?
Why didn't the method parameters and return value type?

Time:09-24

CodePudding user response:

Because this is a constructor

CodePudding user response:

Constructor parameters can have, do not need to return type, it calls an instance structure

CodePudding user response:

reference 1st floor sotondolphin response:
because it's a constructor

How's the difference between constructors and methods

CodePudding user response:

Constructor you can write also can not write write, but the best don't write system will give you create a default without no-parameter constructor
Ordinary method, you want to write or can't use
  • Related