Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A question about constructors
Message
De
23/03/2022 06:59:35
 
 
À
Tous
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Titre:
A question about constructors
Divers
Thread ID:
01683956
Message ID:
01683956
Vues:
36
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é
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform