Difference Between Property And Function.

Posted by Asim Sajjad on Stack Overflow See other posts from Stack Overflow or by Asim Sajjad
Published on 2010-03-30T11:26:48Z Indexed on 2010/03/30 11:33 UTC
Read the original article Hit count: 355

Filed under:

Which one is better to use when it come to return value for example

public int EmployeeAge
{
    get{return intEmployeeAge};
}

And

public int EmployeeAge()
{
    return intEmployeeAge;
}

Which one is better and why? And what is best programming practice to use when we have secnario like above ?

© Stack Overflow or respective owner

Related posts about c#