Discussion :: Properties
-
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?
|
A.
Declare age property with only get accessor. |
|
B.
Declare age propery with only set accessor. |
|
C.
Declare age property with both get and set accessor. |
|
D.
Declare age property with get, set and normal accessors. |
|
E.
None of the above. |
Answer : Option B
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook