Different access modifier for accessors in a propery

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top