Define accessors for Properties with get and set : Properties : Class C# Examples


C# Examples » Class » Properties »

 

Define accessors for Properties with get and set









    
class  MyClass
{
        private  string  name;
        
        public  string  Name
        {
                get  
                {
                        return  name;
                }
                set  
                {
                        name  =  value;
                }
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Properties