What do we mean by Set property in Dot net?

 Posted by Rajesh_Kumar on 2/14/2014 | Category: C# Interview questions | Views: 2311 | Points: 40
Answer:

Set property is also very useful in Dot Net.It is also known as Write-Only property.We use this property to set or assign any value to any variable from anywhere in the class.
The set property is also enclosed in curly braces({ }) and it must be assigned any value.

Syntax:-
set { variable_name = value; }


Where value is we assign value to variable_name.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response