|
INTERVIEW QUESTIONS
MICROSOFT
C#
DETAILS
Question: Does C# support parameterized properties?
Answer: No. C# does, however, support the concept of an indexer from language spec. An indexer is a member that enables an object to be indexed in the same way as an array. Whereas properties enable field-like access, indexers enable array-like access. As an example, consider the Stack class presented earlier. The designer of this class may want to expose array-like access so that it is possible to inspect or alter the items on the stack without performing unnecessary Push and Pop operations. That is, Stack is implemented as a linked list, but it also provides the convenience of array access. Indexer declarations are similar to property declarations, with the main differences being that indexers are nameless (the name used in the declaration is this, since this is being indexed) and that indexers include indexing parameters. The indexing parameters are provided between square brackets.
|
|
|
Category |
C# Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 10092 users |
Added on |
10/24/2009 |
Views |
70663 |
Rate it! |
|
|
Question:
Does C# support parameterized properties?
Answer:
No. C# does, however, support the concept of an indexer from language spec. An indexer is a member that enables an object to be indexed in the same way as an array. Whereas properties enable field-like access, indexers enable array-like access. As an example, consider the Stack class presented earlier. The designer of this class may want to expose array-like access so that it is possible to inspect or alter the items on the stack without performing unnecessary Push and Pop operations. That is, Stack is implemented as a linked list, but it also provides the convenience of array access. Indexer declarations are similar to property declarations, with the main differences being that indexers are nameless (the name used in the declaration is this, since this is being indexed) and that indexers include indexing parameters. The indexing parameters are provided between square brackets. Source: CoolInterview.com
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 |
|
How do you inherit from a class in C#?
|
View Answer
|
|
Does C# support multiple inheritance?
|
View Answer
|
|
Describe the accessibility modifier protected internal.
|
View Answer
|
|
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?
|
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
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All C# Interview Questions & Answers - Exam Mode /
Learning Mode
|