C# Programming - Properties - Discussion

Discussion Forum : Properties - General Questions (Q.No. 17)
An Employee class has a property called age and emp is reference to a Employee object and we want the statement Console.WriteLine(emp.age) to fail. Which of the following options will ensure this functionality?
Declare age property with only get accessor.
Declare age property with only set accessor.
Declare age property with both get and set accessors.
Declare age property with get, set and normal accessors.
None of the above
Answer: Option
No answer description is available. Let's discuss.
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.