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 / akshay

Constants :

* Constant value. Cannot be changed once initialized.
Should be Initialize the value where it declared.
* Const value fully evaluated at compile time
* By default static
* Possible to declare within function

Readonly :

* Could be declare as Static or Non Static
* Assign the value where it declared or can be assigned in
constructor
* Could not declare within function
* can be initialized in compile time or in runtime.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which programming language is best for desktop applications?

889


Is hashset serializable c#?

928


What is the difference between static and private constructor in c#?

957


What is multicast delegate explain with example?

929


When Should You Call The Garbage Collector In .net?

995


What is a collection in c#?

876


Define satellite Assembly?

939


list the steps in code compilation in c#?

817


Why do we use partial class in c#?

838


Are there functions in c#?

916


What is use of a HashTable in .NET?

1105


What is the difference between system.text.stringbuilder and system.string?

971


What is the difference between list and array in c#?

954


What is the difference between ienumerable and enumerator?

866


List some of the classes used by system.data namespace?

794