Different access modifier for accessors in a propery

  • Thread starter Thread starter Romain TAILLANDIER
  • Start date Start date
R

Romain TAILLANDIER

hi group

I want to do somethng like that :

class MyClass
{
public int _a = 0;
int a
{
public get{return _a;}
protected set{_a = value;}
}
//OR
public int _b = 0;
public int b { get{return _b;} }
protected int b { set{_a = value;} }

}

but it is impossible.
Is there an alternative other than to have two properties with 2 names, or a
SetA(int a); method ?

thanks
ROM
 
Back
Top