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

Explain diff between dataset and datareader?

533


What is viewstate? In which event of the page life cycle, is the viewstate available?

605


What are the main advantages of using asp.net?

558


What is masterpage?

514


What is the concept of view state in asp.net?

565






How would you turn off cookies on a page of a website?

508


How can we apply themes to an asp.net application?

562


Give an example of what might be best suited to place in the application_start and session_start subroutines?

528


What are tuples?

543


What is s2s tracking?

537


What is a web server? What are the load limits in it?

592


What is state management react?

514


What are the new features implemented in ASP.NET?

611


What is difference between web api and web services?

537


What is the use of ASP.NET routing?

562