0
    public class AutomaticProperty 
  {
       public integer MyReadOnlyProp { get; }
       public string MyWriteOnlyProp { set; }
    }

could you please give any examples related to this concept.can we use any where only get and only set?

Thanks in advanced!!!

2

V.Suresh,

You can take help from this link http://www.forcetree.com/2009/07/getter-and-setter-methods-what-are-they.html

Let me know if this helps.

  • No problem mate, you can mark it as answer if it served your purpose. – Ajay Dubedi Jun 24 '15 at 14:05
0

just because it exists, doesn't mean it is useful.

You could imagine something like a random number generator having a Integer seed {set;} property, but I'd be inclined to write void setSeed(Integer x) method instead.

  • Hi Mark, This post gave me a clear idea of get set. thankyou – user17646 Jun 24 '15 at 14:00