PROBLEM IN GET AND SET THE DATA FIELD

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
OOPS 
 1691  View(s)
Ratings:
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?
  1. Awadhendra Tiwari

    Post:126

    Points:882
    Re: problem in get and set the data field

    Hi..

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!