Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is clr in .net?

1095


How many types of generations are there in a garbage collector?

971


Explain the difference between the while and for loop. Provide a .net syntax for both loops?

979


Explain dataset.acceptchanges and dataadapter.update methods in .net?

1003


Why you want to leave your previous company.

2109


How do I use the thread pool?

1049


How does cas works?

998


What is Complex Class in .NET?

1032


How to debug failed assembly binds?

1041


Explain the features that are common to all .Net languages.

1163


What is COM Interoperability in .NET

1089


Explain the difference between the while and for loop.

991


What is boxing and un-boxing in .net?

1071


Tell me what is a “jagged array”?

1045


What is a variable of implicit type and what is its scope?

923