Can we use optional parameters in a constructor?

You can use optional parameters in Methods, Constructors, Indexers, and Delegates . Each and every optional parameter contains a default value which is the part of its definition. If we do not pass any parameter to the optional arguments, then it takes its default value.

Sizin İçin Seçtik  How does NASA use electromagnetic waves?

Leave a Reply

Your email address will not be published. Required fields are marked *

Can we use optional parameters in a constructor?

You can use optional parameters in Methods, Constructors, Indexers, and Delegates . Each and every optional parameter contains a default value which is the part of its definition. If we do not pass any parameter to the optional arguments, then it takes its default value.

Sizin İçin Seçtik  Can parameters be optional?

Leave a Reply

Your email address will not be published. Required fields are marked *