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 lock statement in C#?

1014


What is an object and a class?

1014


What is the difference between hashtable and dictionary?

958


What is a static class in c#?

1016


What are the types of comments in c#?

996


Is the following code legal?

978


Define property in c#.net?

966


What is difference between abstract class and interface in c#?

954


Is char * null terminated?

942


Explain how to parse a datetime string?

930


Is list passed by reference c#?

893


What I can do with c#?

955


What is the difference between a variable and a literal?

1062


What is the use of generics in c#?

873


What is the predicate of a sentence?

920