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

Answer Posted / vijay bhaskar semwal

some more difference
Unlike const, when using readonly, the value is set when
the instance is created. This means that you can specify
the value of the readonly in the constructor of your class.

Another difference between const and readonly, is that
const are static by default, where with readonly, you must
define it as static (if you want it to be).

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data set in c#?

976


What is ControlBox Propertie

1055


Is it possible to have a static indexer in c#?

1023


Is it possible to execute multiple catch block for a single try statement?

1103


What does namespace mean?

1001


What is yield in c#?

918


Is c# and .net same?

916


How do I declare inout arguments in c#?

975


Is c sharp and c# are same?

970


Can dictionary have duplicate keys c#?

926


What is a di class?

1135


Why delegate is used in c#?

972


What is icomparer in c#?

976


What is the max value of int32 in c#?

963


What is the usage of OLE?

1058