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

Answer Posted / kamlesh sharma

readonly variables are can be initilized at compile time
but we can assign values to readonly varialble at once
through functions or constructors

but in case of constant variables once assign a value we
can't change value and must assign value to constant
variables at the time of declarition

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Elaborate differentiation between Cache and Application?

725


What do you mean by serialize and marshalbyref?

765


What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?

704


What is new asp.net core?

775


Explain the difference between webfarm and webgardens in .net?

732


What is a web based system?

678


What is the default authentication mode for asp.net?

790


Can we have multiple master pages in asp net?

713


What are Master Pages in ASP.NET? or What is a Master Page?

825


What is viewstategenerator?

935


What do you mean by authorization?

716


What is the use of view state?

721


Why session is necessary in web application?

725


Can viewstate be accessed in another page?

730


What is the difference between system.stringbuilder and system.string

471