Comparing Properties to Methods

Similarities
1.Both contain code to be executed
2. Both can be used to hide implementation details
3. Both can be virtual, abstract, or override

 Differences
1. Syntactic – properties do not use parentheses
2.Semantic – properties cannot be void or take arbitrary
  parameters

你可能感兴趣的:(properties)