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 read only and constant

Answer Posted / vathsala

A quick synopsis on the differences between 'const'
and 'readonly' in C#:

'const':
1.Can't be static.
2.Value is evaluated at compile time.
3.Initiailized at declaration only.

'readonly':
1.Can be either instance-level or static.
2.Value is evaluated at run time.
3.Can be initialized in declaration or by code in the
constructor.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between a struct and a class?

959


What is a template class?

1021


Explain the types of assemblies in .net?

960


What is assembly c#?

884


How does the lifecycle of Windows services differ from Standard EXE?

1022


Can abstract classes be final?

942


What is difference between new and override in c#?

878


Why do you need boxing in c#?

920


Is predicate a functional interface?

973


What is lazy t?

953


What language is arduino?

993


What is the difference between finalize() and dispose() methods?

996


What is difference between c sharp and c#?

908


What does void mean unity?

951


Does hashset allow duplicates c#?

987