What is the use of SET and GET in Property Data Member in Class in C#

Last Reply on Aug 06, 2013 07:22 AM By Mudassar

Posted on Aug 06, 2013 07:21 AM

what are the set and get

in this code what its use

  public class Members_Only
        public int Height { get; set; }
        public int Width { get; set; }

Posted on Aug 06, 2013 07:22 AM

It is a class DataMember or in order words property. It is used to hold data and must have any one or both set and get methods

If you have set method you can save data and if you have get method you can get the saved data