Readonly properties | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Readonly properties

Trying to use readonly keyword to apply on a "readonly property" but seems not work. Some way? Or must made it without readonly keyword using "private set"? Thx

25th May 2020, 8:51 PM
Kiwwi#
Kiwwi# - avatar
1 Answer
+ 1
If you want your property to be readonly, you just leave out the "set" part.
25th May 2020, 10:50 PM
CapCode