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 the difference between throw and throw ex?

883


What is final keyword in c#?

999


What is multithreading with .net?

1004


Is string immutable in c#?

1009


What is orm in c#?

973


What is use of console?

923


What is difference between const and static in c#?

992


What is a linq in c#?

885


What is an indexer in c#?

972


What is a service layer c#?

861


Explain the difference between proc. Sent by val and by sub?

929


What is difference between gridview and form view?

1013


What are collection classes?

943


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

879


Explain about accessibility modifier 'protected internal'?

1012