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

Can an exception be thrown from a catch block?

568


What is a static property. Give an example?

518


Can you store strings in arrays?

537


what are pointer types in c#

548


What is the difference between “finalize” and “finally” methods in c#?

469






What is ilasm.exe used for?

504


What is namespace in oop?

486


What is datasource c#?

487


What is difference between class and abstract class in c#?

457


What do you mean by jagged array?

485


What is session state in asp net c# with example?

469


What do you mean by object pooling?

519


What is difference between private and static constructor?

462


How does foreach loop work in c#?

478


What problem does Delegate Solve?

564