Which keyword prevents member of a class from being modified after construction ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

Which keyword prevents member of a class from being modified after construction ?

CSharp

16th Jan 2018, 2:54 PM
Ali Abdulbasit
Ali Abdulbasit - avatar
5 Answers
+ 8
readonly is the answer
17th Jan 2018, 4:02 PM
Ali Abdulbasit
Ali Abdulbasit - avatar
+ 7
thanks jay const also
16th Jan 2018, 7:55 PM
Ali Abdulbasit
Ali Abdulbasit - avatar
+ 4
private : makes it available only in ur class sealed: prevent other classes from inheriting from ur class
16th Jan 2018, 7:40 PM
jay
+ 3
readonly
5th Feb 2018, 8:51 AM
Ioannis Alexandros Makropoulos
Ioannis Alexandros Makropoulos - avatar
+ 1
readonly
15th Feb 2018, 3:33 PM
Joachim Shilongo
Joachim Shilongo - avatar