private float fsalary =20000;
public float Salary
public float Salary
{
set { fsalary = 500102; }
}
Emp e=new Emp();
Console.WriteLine("The Emp salary is:{0}",e.Salary);
How to access set property?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 1, 2013, 11:16 PM EDT
You should try like this
e.Salary=500102;
Regards,
Iftikar
Vijay134 reputationPosted Aug 1, 2013, 11:21 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 1, 2013, 11:26 PM EDT
Regards,
Iftikar
Vijay134 reputationPosted Aug 1, 2013, 11:31 PM EDT