|
INTERVIEW QUESTIONS
MICROSOFT
C#
DETAILS
Question: C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Answer: Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there is no implementation in it.
|
|
|
Category |
C# Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8569 users |
Added on |
10/24/2009 |
Views |
71895 |
Rate it! |
|
|
Question:
C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Answer:
Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there is no implementation in it. Source: CoolInterview.com
Well I think it should be one. As by default the constructor without parameter is verymuch included one just need to have a parameterised constructor. Source: CoolInterview.com
Answered by: Harish | Date: 5/31/2010
| Contact Harish
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is a delegate?
|
View Answer
|
|
What is a multicast delegate?
|
View Answer
|
|
What are the ways to deploy an assembly?
|
View Answer
|
|
What is a satellite assembly?
|
View Answer
|
|
What namespaces are necessary to create a localized application?
|
View Answer
|
|
What is the difference between // comments, /* */ comments and /// comments?
|
View Answer
|
|
How do you generate documentation from the C# file commented properly with a command-line compiler?
|
View Answer
|
|
Is XML case-sensitive?
|
View Answer
|
|
What does the This window show in the debugger?
|
View Answer
|
|
What does assert() do?
|
View Answer
|
|
What is the difference between the Debug class and Trace class?
|
View Answer
|
|
Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
|
View Answer
|
|
Where is the output of TextWriterTraceListener redirected?
|
View Answer
|
|
Can you change the value of a variable while debugging a C# application?
|
View Answer
|
|
Explain ACID rule of thumb for transactions.
|
View Answer
|
|
What connections does Microsoft SQL Server support?
|
View Answer
|
|
Which one is trusted and which one is untrusted?
|
View Answer
|
|
Why would you use untrusted verificaion?
|
View Answer
|
|
What does the parameter Initial Catalog define inside Connection String?
|
View Answer
|
|
What is the data provider name to connect to Access database?
|
View Answer
|