Ranganath Prasad
C# Property Vs Method

Tell me one thing a Property CAN DO that a Method CANNOT DO ?

By Ranganath Prasad in C# on Jan 16 2022
  • Arvind Yadav
    Jan, 2022 28

    In general, methods represent actions and properties represent data. Properties are meant to be used like fields, meaning that properties should not be computationally complex or produce side effects. When it does not violate the following guidelines, consider using a property, rather than a method, because less experienced developers find properties easier to use.

    • 3
  • Jin Vincent Necesario
    Feb, 2023 4

    Here are my thoughts:

    1. Properties – It expresses a certain features/characteristics of an object.
      • Allows you to set/get in a common pattern
      • A handy way of saying if certain features are on or off.
      o IsProduct
      o IsAvailable
      o Amount
    2. Methods – are expressed for things that may change, expecting something to return.
      Usually, methods are defined as verbs. That is why you will hear from developers that methods are action(s).

    • 1
  • Ashish Gangwar
    Jul, 2022 20

    A method is a set of statements that is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method’s name.Method take some input as parameters and return the result as a return value.
    A property is a member of a class which is used to set and get the data from a data field of a class. A property is never used to store data, it just acts as an interface to transfer the data. We use the Properties as they are the public data members of a class, but they are actually special methods called accessors.

    • 1
  • Ashish Gangwar
    Jul, 2022 20


    A property is a member of a class which is used to set and get the data from a data field of a class. A property is never used to store data, it just acts as an interface to transfer the data. We use the Properties as they are the public data members of a class, but they are actually special methods called accessors.


    A method is a set of statements that is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method’s name.

    • 0
  • Vishal Yelve
    Jul, 2022 8

    A property is a named attribute of an object. Properties define the characteristics of an object such as Size, Color etc. or sometimes the way in which it behaves. A method is an action that can be performed on objects.

    • 0
  • sukanth gollamandala
    Feb, 2022 21

    In property we can declare get or set or both values, In method by using those properties we can do the coding.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS