This question may look silly for some but I want to understand the concept behind, I have a single property(i.e TestNumber
) within a TestClass
.
public class TestClass
{
private uint testNumber=0;
public uint TestNumber
{
get { return testNumber; }
set { testNumber = value; }
}
public TestClass ()
{
TestNumber = 0;
// or
testNumber = 0;
}
}
Now, if I want to set
or get
the value of the property outside the class, I can simply do the following,
TestClass tc = new TestClass ();
tc.TestNumber = 10;
but my question is if I want to access this property within the same class, I have two options either I can use
testNumber = 0;
or
TestNumber = 0;, so which one is correct & why?
Thanks!