C# Programming - Constructors - Discussion

Discussion Forum : Constructors - General Questions (Q.No. 17)
17.
Which of the following statements is correct about constructors in C#.NET?
A constructor cannot be declared as private.
A constructor cannot be overloaded.
A constructor can be a static constructor.
A constructor cannot access static data.
this reference is never passed to a constructor.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Vidit said:   1 decade ago
We can not create any instance of static class but static class have static constructor which works to initialize the class data members.

J.harika said:   1 decade ago
We can not declare a constructor as private we we declare like that we can not create object out side the class. I think the correct answer is option A.

Karishma said:   1 decade ago
@J.Harika.

Correct answer is C only, and constructor can be declared as private.

Anynymous said:   9 years ago
@Karishma : Answer is C and A. You can not declare a constructor as private as well. The visual studio throws an error.

Sridhar said:   7 years ago
I think option is A, Why because constructor will declare always public not a private.

Post your comments here:

Your comments will be displayed after verification.