Property is Smart Method.
below given property example.
below given property example.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Property_example { class Test { uint _myprop; public uint MyProp { set { _myprop=value; } get { return _myprop; } } static void Main(string[] args) { Test t = new Test(); t.MyProp = 100; Console.Write("Positive No. "+t.MyProp); Console.ReadLine(); } } }
No comments:
Post a Comment