C# Programming - Constructors - Discussion

Discussion Forum : Constructors - General Questions (Q.No. 5)
5.
Which of the following statements is correct about constructors?
If we provide a one-argument constructor then the compiler still provides a zero-argument constructor.
Static constructors can use optional arguments.
Overloaded constructors cannot use optional arguments.
If we do not provide a constructor, then the compiler provides a zero-argument constructor.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Jaya said:   10 years ago
If we don't provide constructor, then by default. Default constructor will called without any parameter.

Sank said:   1 decade ago
Although main () method is static why then it access all methods of static and non-static?

Rajeev said:   1 decade ago
If we do not provide a constructor that means all the time default constructor will called which is by default PUBLIC and without parameters. That is why ---

"If we do not provide a constructor, then the compiler provides a zero-argument constructor."

Malathisachu said:   1 decade ago
If constructor is not used than c# create default constructor while executing the program.

Post your comments here:

Your comments will be displayed after verification.