The correct way to implement a read only property add, in a math class is?

The correct way to implement a read only property add, in a math class is?
A.
Code:
   class math
   {
       int ad;
       public int add
       {
           get
           {
               return ad;
           }
       }
   }
B.
Code:
   class math
   {
      public int add
      {
          get
          {
              return ad;    
          }
      }
  }
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