locked
Property Get;Set; RRS feed

  • Question

  • Hello Friends ! I create one Class Employee. and I used it as like...

    Public Employee emp

    {

    get;

    set;

    }

    but what is the diffrent between

     Employee objemp = new Employee();

    and above top level Property class.I cannnot used Object of employee???

     

     

     

    Monday, October 25, 2010 12:07 PM

Answers

  • The code you are using creates an anonymous private variable to store the data for the property; without specifying the name of the private variable, you won't be able to access it (apart from using the public property).
    Monday, October 25, 2010 6:51 PM