Difference Between ReadOnly and Constant Variable in
compile time and Run Time.

Answer Posted / saiish bhat

readonly is compile time constant.
constant is runtime constant.

constatnt field is used to initialize at the declaration of
the field.
readonly field is used at the declaration or constructor of
the field.

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between stored procedure vs function?

564


What is ispostback method in asp.net?

544


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

1402


What does the hotspot class in .net do?

559


What is difference between abstract class and an interface?

494






What is advantage of code behind coding in ASP.NET?

552


Which .NET framework supports Web API?

584


Is it possible to change the index of primary key on table?

398


What is the difference between CLICK and MOUSE DOWN Event ?

577


What is web configuration file and how to use in web application

585


What is the life cycle of an asp.net page?

521


Explain why it is useful to use mvc instead of webforms? : asp.net mvc

587


What is the base class from which web forms are inherited?

520


What can we do with asp.net?

500


When we use cookie less session? Explain its working?

557