In order to do any modifications by executing threads, volatile
modifier is used.
is applicable only for a class or struct. We can apply it to the field types such as integral, reference, pointer, enum and generic.
public volatile int clr; // volatile field
clr = blue;
Asked In: Spotted While Learning |