What is the Difference between read only and constant
variables?
Answer Posted / akshay
Constants :
* Constant value. Cannot be changed once initialized.
Should be Initialize the value where it declared.
* Const value fully evaluated at compile time
* By default static
* Possible to declare within function
Readonly :
* Could be declare as Static or Non Static
* Assign the value where it declared or can be assigned in
constructor
* Could not declare within function
* can be initialized in compile time or in runtime.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is datatable and dataset in c#?
how to compare numbers and dispaly the largest ? *first thing I wanted to do is to input how many numbers to be compared *and then analyzed the largest then display it.
What is the extension of c# file?
Give an example of a ctype.
How do I run managed code in a process?
Is static thread safe?
What is the purpose of reserved word using in c#?
What is a static class in c#?
What is assembly and dll in c#?
Is vs as c#?
What is the execution entry point for a c# console application?
What is access modifier in c#?
What is public void in c#?
What is cookies c#?
What is overloading with example?