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

What is use of list in c#?

861


Is c# the same as d flat?

913


Is a decimal an integer?

871


What are the return types in c#?

957


What is difference between array and arraylist c#?

1039


Why do we need indexers in c#?

920


Define c# i/o classes? List the commonly used classes?

984


What is boolean method?

944


Define acid rule of thumb for transactions in c#.

895


Structs are largely redundant in c++. Why does c# have them?

1257


What are the advantages of properties in c#?

973


How do you declare an arraylist?

985


What are the types in c#?

909


If the original method is not static you can declare an override method to be static or not?

937


What does using system mean in c#?

1009