How is a property designated as read-only?
Answer Posted / deep
In VB.NET:
Private mPropertyName as DataType
Public ReadOnly Property PropertyName() As DataType
Get Return mPropertyName
End Get
End Property
In C#
Private DataType mPropertyName;
public returntype PropertyName
{
get{
//property implementation goes here
return mPropertyName;
}
// Do not write the set implementation
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Elements of CAS
What are the advantages of .net?
Explain me how does linq work?
Is atl redundant in the .net world?
What is cyclomatic complexity and why is it important?
What is .net technology?
What is dot net architecture?
What are the authentication methods in .net?
What is common language specification (cls)?
Describe session handling in a webform, how does it work and what are the limitations?
What is close method? How its different from finalize and dispose?
Explain clr, cts and cls?
Please explain what is reflection and what is it for?
What are the differences between user control and server control?
Explain what is the difference between odbc and ado?