InterviewSolution
Saved Bookmarks
| 1. |
Is It Possible To Have Different Access Modifiers On The Get/set Methods Of A Property? |
|
Answer» No. The access modifier on a PROPERTY applies to both its get and set ACCESSORS. What you NEED to do if you want them to be different is MAKE the property read-only (by only providing a get accessor) and create a private/internal set method that is separate from the property. No. The access modifier on a property applies to both its get and set accessors. What you need to do if you want them to be different is make the property read-only (by only providing a get accessor) and create a private/internal set method that is separate from the property. |
|