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

How can you force derived classes to provide new method implementations for virtual methods?

862


How can I check the type of an object at runtime?

921


Define a partial class?

867


What is use of private class in c#?

934


What is assembly manifest?

973


Explain the difference between access specifier and access modifier in c#?

932


What is use of FormBoarderStyle Propertie

883


Why are mutable structs evil?

917


What is the concept of strong names?

934


What is boolean method?

911


How do you pronounce c#?

852


Define multicast delegate in c#?

895


What is a static in c#?

874


Distinguish between array and arraylist in c#?

974


What are console applications used for?

881