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

Describe a Windows Service and its lifecycle ?

620


What is asp short for?

556


Distinguish between Server-side and Client-side code?

552


List the types of authentication supported by asp.net?

523


Which type if caching will be used if we want to cache the portion of a page instead of whole page?

499






Can we have multiple master pages in asp net?

507


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

595


What is the concept of postback in asp.net?

588


What is the full meaning of asp.net?

524


What is parse in asp.net?

550


How can i explain my project during interview?many time i expalain my project but they did't accept? please explain me.

5069


What are the difference between function and stored procedure in .net programming language?

251


What is the request flow used for asp.net mvc framework? : asp.net mvc

529


What is redirectpermanent in asp.net?

608


What are the new features implemented in ASP.NET?

599