What is a readonly modifier in C# programming language?

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

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