Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Property vs. Method
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01354904
Message ID:
01354907
Views:
19
>>The age old questions. Should I use a property or a method? Is one faster than the other?
>
>?? A property is a piece of information. A method DOES something. Very different.

Property:
public bool IsMyBirthDay
{
  get{return DateTime.Today == new DateTime(1976, 1, 15);}
}
Method:
public bool IsMyBirthDay()
{
  return DateTime.Today == new DateTime(1976, 1, 15);
}
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform