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
When displaying fonts, what is the difference between pixels, points and ems?
What is meant by globalization?
What is lambda expressions in c#?
State some of the different languages supported by .net?
What is .net standard?
Tell us what is heap and what is stack?
What exactly is being serialized when you perform serialization in .net?
What are the new features of Framework 1.1 ?
Explain the difference between .net 2000 and .net 2005(features)? Which one is better?
What is RPC? What is the use of it?
Is .net core installed?
Difference between class and interface in .net?
What are the new 2.0 features useful for?
What data providers available in .net to connect to database?
What is the difference between .net 2000 and .net 2005(features)? Which one is better?