What is a readonly modifier in C# programming language?

 Posted by Goud.Kv on 9/1/2014 | Category: C# Interview questions | Views: 224 | Points: 40
Answer:

In order to prevent any further modifications to a field after its declaration, readonly keyword is used.

public class MyClass

{
readonly int color; // Read only and cannot be modified
}


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response