What is the Difference between read only and constant
variables?

Answer Posted / raju

1.We can assign value to readonly field, only in
constructor or while declare the variable.But in case of
const we should assign a value while declare.
2.const=static readonly

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is callback method in c#?

488


Is javascript harder than c#?

511


Explain the constructor in c#.

570


What are c# collections?

473


What is ienumerable t in c#?

486






What are the benefits of using the aggregate method in linq?

503


Can I call a virtual method from a constructor/destructor?

483


What is class method c#?

481


What does mean c#?

530


what are the different ways a method can be overloaded?

519


Are c# strings null terminated?

534


What is extended class in c#?

472


What do you mean by jagged arrays in c#?

485


Explain the use of virtual, sealed, override, and abstract method?

478


Why do we use abstract class in c#?

490