“Read only” Property Accessor in C#

前端 未结 8 1596
遇见更好的自我
遇见更好的自我 2021-02-12 14:08

I have the following class:

class SampleClass
{
   private ArrayList mMyList;

   SampleClass()
   {
       // Initialize mMyList
   }

   public ArrayList MyLis         


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 14:47

    Available from .NET v2.0

        public ArrayList MyList { get; private set; }
    

提交回复
热议问题