Home > DeveloperSection > Forums > problem in get and set the data field
Vikas Giri
Vikas Giri

Total Post:13

Points:91
Posted on    January-29-2011 8:11 AM

 OOPS OOPS 
Ratings:


 1 Reply(s)
 1426  View(s)
Rate this:
we write this code but give the exception 
 class Program
    {
        static void Main(string[] args)
        {
            aa a = new aa();
            a.ff = 19;
        }
    }
    public class aa
    {
        int f1;
        public int ff
        {
            set
            {
                System.Console.WriteLine("in set " + value);
                f1 = value;
            }
        }
    }
what is the accurate solution of its?


Awadhendra Tiwari

Total Post:126

Points:882
Posted on    May-20-2011 8:40 AM

Hi..

Are you sure that these set of codes give exception becuse I had tested it and it successfully execute.


Don't want to miss updates? Please click the below button!

Follow MindStick