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
what is machine key error in .NET how can we solve it?
What is RPC? What is the use of it?
Explain the difference between .net 2000 and .net 2005(features)? Which one is better?
Can a try block have more than one catch block?
Different between .net & j2ee ?
Explain what is a delegate?
What data providers available in .net to connect to database?
What is a formatter in .net?
What is immutability?
What are the new thee features of com+ services, which are not there in com (mts)?
why you wouldn't want to write into it even if you could
Please explain what is a delegate?
What is cyclomatic complexity and why is it important?
What is the difference between asp.net and asp?
Explain how viewstate is being formed and how it's stored on client in .net?