Can you have different access modifiers on the get/set methods of a property in C#?

 Posted by Virendradugar on 12/15/2009 | Category: C# Interview questions | Views: 9419

No. it's not possible. The access specifier has to be same for get and set.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Laksivanna on: 12/31/2009
it's possible like
public int Value
internal set;
the set access specifer is internal now.
Posted by: Mpandu on: 6/16/2010
It is possible to specify access modifiers on set and get in vs 2008.

Login to post response