Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between readonly and const

Answer Posted / sabina

both meant for constant values. a const field can only be
initialized at the declaretion of the field. a read only
field can be initialized either in initialization or in
constructer. therefore , reaadonly field can have different
values depending on the constructure used

also a const field is compile time constant , readonly
field can be used for runtime constants

Is This Answer Correct ?    18 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need private constructor in c#?

847


Why is c# a good programming language?

940


What is parseexact c#?

921


What is a shared assembly?

933


Describe the ways of cleaning up objects in c#.

864


What is the difference between int and int in c#?

956


Are cao stateful in nature?

855


What are the properties of a string class?

963


What is eager loading in c#?

859


Define strong name in c#?

879


Whats an assembly? Describe the importance of assembly?

862


What is assembly manifest?

977


Why do we use delegates in c#?

868


What is the use of xmlserializer?

829


What is the base class of all classes in c#?

966