Amit Soni
what are the differences between property and local variable in C#???
By Amit Soni in ASP.NET on Sep 24 2007
  • Arjun Hotwani
    Sep, 2007 25

    Main differences between property and local variable ( Though I believe comparing property and member variable is more approprate.)

    Local variable is declared as a single statement whereas property is a series of statmenets.

    Local variable is declared in procedure and scope remains within procedure whereas Property is associated with a class or module.

    Local variables has write and read methods whereas property has get and set methods.

    Local Variable is stored at a specific memory location and it can be accessed with memory operations. Property value may or may not be accessed.

    • 0
  • Vimal Chauhan
    Sep, 2007 25

    We can define a property as ReadOnly by using the set method, whereas in case of variable that is not posible

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS