ReadOnly Get and private Set propertie?

  • Thread starter Thread starter Norton
  • Start date Start date
N

Norton

Is it possible to have a property that is Public read only and private
writable? What would the syntax look like?

Thanks.

NortonZ
 
Current .NET versions do not support it. But, it is in .NET 2.0!

Is it possible to have a property that is Public read only and private
writable? What would the syntax look like?

Thanks.

NortonZ
 
How about this...?

class MyClass
{
public int Value { get{ return value; } } // readonly property
private int value; // private variable
}
 
Back
Top