Exploring the online world is my passion. have experience of #content writing #SEO #Digital Marketing #On-Page #Lead Generation #Content Analyst #Marketing Analyst...
I could never stop at one point, continuously wanted to acquire more and more skills. My work for any organization will be full of passion and hard work.
Hemant Patel
02-Mar-2017The difference is that the value of a static readonly field is set at run time, so it can have a different value for different executions of the program. However, the value of a constant field is set to a compile time constant. Read-only variables will be initialized only from the Static constructor of the class.
Initialization of readonly field was not compulsory but in constant it’s compulsory.
Readonly field accessed by object reference and constant accessed by class name.
The value of readonly property can be change, but constant value will be fixed.