G
Gawel
Let say I have:
public class Class1
{
protected int _counter;
public void MakeSomethingWithCounter()
{
_counter = 10;
or <--------------------------which way is morr accurate ?
Counter = 10;
}
public int Counter
{
set { _counter = value; }
get { return _counter; }
}
}
What kind of approach should I choose ?
Property or field ? Property is a method, therefore
using property can be less efficient.....but I can be wrong.
Gawel
public class Class1
{
protected int _counter;
public void MakeSomethingWithCounter()
{
_counter = 10;
or <--------------------------which way is morr accurate ?
Counter = 10;
}
public int Counter
{
set { _counter = value; }
get { return _counter; }
}
}
What kind of approach should I choose ?
Property or field ? Property is a method, therefore
using property can be less efficient.....but I can be wrong.
Gawel