I'm trying to compile following code :
internal volatile bool isRunning { get; set; }
But the compilation fails with error message like: "the volatile modifier is not valid for that element". But the following code will be compiled fine:
internal volatile bool _isRunning;
internal bool isRunning{
get { return _isRunning; }
set { _isRunning = value; }
}
What is the difference between both code snippets??