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
How will you do redo and undo in textbox control?
What are the improvements made in cas in .net 4.0?
Explain how does assembly versioning work?
Explain what does managed mean in the .net context?
What are virtual destructures?
What is the difference between a debug and release build?
What is singleton activation mode in .net?
What are data types in .NET?
What is .net environment?
How to produce an assembly?
Tell about your technical profile ?
What does mean by .net framework?
What is the reason of occurring overflow-underflow arithmetic exception error, it shows error message when we run our program by adding control?
I'm having some trouble with cas. How can I troubleshoot the problem?
How will you make .NET programs work in Linux ?