Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constructor
Message
De
26/03/2022 14:44:21
 
 
À
24/03/2022 09:56:24
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01683967
Message ID:
01683993
Vues:
46
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform