1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Purpose of having Properties in Interface

Discussion in 'C#' started by visualcpp, Apr 3, 2007.

  1. visualcpp

    visualcpp New Member

    Joined:
    Apr 3, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Hai!
    I couldn't understand the purpose of having Properties in interface. If any one having clear information about this, please share it.

    Thanks in advance!

    Regards,
    visualcpp
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    Its same as the get set methods that we used to write in old days. To share the values of the variables to the outside world
     
  3. visualcpp

    visualcpp New Member

    Joined:
    Apr 3, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Yes. I understand the purpose and concept of properties. That is perfectly ok for class's. Why should we have properties in interface as it doesn't contain any memberdata to wrap around (like class's)?
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    You can always have a data in a class which can be stored.

    Its something like writing the get set methods/
     

Share This Page