Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constructor
Message
From
26/03/2022 14:44:21
 
 
To
24/03/2022 09:56:24
General information
Forum:
C#
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01683967
Message ID:
01683993
Views:
45
>Hello all,
>
>Are there cases where it's better to not add the constructor for a class?
>
>I would say no but that's why I ask the question :-)
>
>Regards

Yes, there are cases when you don't need a constructor.
You'll need a constructor if:
- you are passing parameters when you instantiate an object of the class
-you are doing some initialization when you instantiate an object of the class.
- you are using polymorphism.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform