The correct way to implement a write only property add in a math class?

Nguyên Lê

New member
The correct way to implement a write only property add in a math class?
A.
Code:
   class math
   {
       public int add
       {
           set
           {
                add = value;
            }
        }
    }
B.
Code:
   class math
   {
       int ad;
       public int add
       {
           set
           {
               ad = value;
           }
       }
   }
C.
Code:
  class math
  {
      int ad;
      public int add
      {
          get
          {
              return ad;
          }
          set
          {
              ad = value;
          }
      }
  }
D. None of the mentioned
 

Tìm kiếm

Back
Top