+ 1
Which accessory create a read only property ? Ans is set explain ? why not get accessor
2 Réponses
+ 3
If you omit the set method in a property. You cannot assign a value to the property. There fore it is read-only.
So the set method itself does not make the property read-only, but omitting the set metjod does.
if you have access to visual studio. Start a new project. Make a class. Make a property in this class. Do omit the set method of the property. Try to assign a value to this property. Visual studio will give an error, saying it is read-only.
- 1
i am confuse get and set method