locked
static properties RRS feed

  • Question

  • User-1002109996 posted

    In project there are many static properties are used. how safe it's used . i don't known why we are using static propertices.

    Monday, June 17, 2013 3:04 AM

Answers

  • User-1373950060 posted

    Hi,

    A static propertyis similar to a static method. It uses the composite name to be accessed. Static properties use the same get and set tokens as instance properties. They are useful for abstracting global data in programs. When a property declaration includes a static modifier, the property is said to be a static property. When no static modifier is present, the property is said to be an instance property. A static property is not associated with a specific instance, and it is a compile-time error to refer to this in the accessors of a static property.

    For Static and instance properties: http://msdn.microsoft.com/en-us/library/aa664451(v=vs.71).aspx#feedback

    For example: http://www.dotnetperls.com/static-property

    Hope that's helpful.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 18, 2013 4:15 AM

All replies

  • User309602797 posted

    static property is similar to a static method. It uses the composite name to be accessed. Static properties use the same get and set tokens as instance properties. They are useful for abstracting global data in programs.

    static properties helps to increase performance of the application,

    they are globaly accessable ,

    static properties are invoked by using the class name.

    following are the links which help you to understand static properties.

    http://msdn.microsoft.com/en-us/library/w86s7x04(v=vs.71).aspx

    http://msdn.microsoft.com/en-us/library/79b3xss3(v=vs.80).aspx


    Monday, June 17, 2013 3:15 AM
  • User-1373950060 posted

    Hi,

    A static propertyis similar to a static method. It uses the composite name to be accessed. Static properties use the same get and set tokens as instance properties. They are useful for abstracting global data in programs. When a property declaration includes a static modifier, the property is said to be a static property. When no static modifier is present, the property is said to be an instance property. A static property is not associated with a specific instance, and it is a compile-time error to refer to this in the accessors of a static property.

    For Static and instance properties: http://msdn.microsoft.com/en-us/library/aa664451(v=vs.71).aspx#feedback

    For example: http://www.dotnetperls.com/static-property

    Hope that's helpful.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 18, 2013 4:15 AM