What is a volatile modifier in C# programming language?

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

In order to do any modifications by executing threads, volatile modifier is used.
volatile is applicable only for a class or struct. We can apply it to the field types such as integral, reference, pointer, enum and generic.

class Color

public volatile int clr; // volatile field
Color(int blue)
clr = blue;

Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response