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 static void main in c#?

1009


Give some examples of commonly used i/o classes?

921


What are the different states of a thread?

928


What is func c#?

996


How do you comment out code in c#?

909


State the top.NET class that everything is derived from?

945


What is the difference between icomparer and icomparable in c#?

940


What is parsing?

930


What is namespace c#?

925


Why do we need to override in c#?

972


What is executereader in c#?

906


How many types of collections are there in c#?

896


What is the output of TextWriterTraceListener redirected?

1050


What is the difference between interface and inheritance in c#?

902


Explain async and await?

1849