Sunday, March 29, 2015

What is the difference between const and static read-only?

Question:What is the difference between const and static read-only??

Answer: <P></P><P align=justify>The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it:</P><P align=justify></P><P align=justify>-- in the variable declaration (through a variable initializer).</P><P align=justify>-- in the static constructor (instance constructors if it&#39;s not static). </P>

Tags:Interview Questions, Microsoft, C#,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Bulk SMS Sending Software

SMS Management System Software

This software used to Send bulk SMS (short text messages) from your computer and assists you to rapidly connect with your customers and staff, communicate with them easily and cheaply, using latest technology that help to generate bulk SMS on just one click to all the database....

No comments:

Post a Comment