Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A question about constructors
Message
From
23/03/2022 06:59:35
 
 
To
All
General information
Forum:
C#
Category:
Coding, syntax and commands
Title:
A question about constructors
Miscellaneous
Thread ID:
01683956
Message ID:
01683956
Views:
35
Not sure if I understand correctly the use of constructors.

Is it a way to make sure that a class will always have parameters initialized the right way?

For example if I don't create a constructor and the class has two parameters that should be integers. it could be called with anything as parameters.

But if I create a constructor for that class and I don't specify these parameters then the editor will tell me about my error?
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Next
Reply
Map
View

Click here to load this message in the networking platform