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

Answer Posted / xiaof

A const field can only be initialized at the declaration of
the field. A readonly field can be initialized either at
the declaration or in a constructor. Therefore, readonly
fields can have different values depending on the
constructor used. Also, while a const field is a compile-
time constant, the readonly field can be used for runtime
constants as in the following example:
public static readonly uint l1 = (uint) DateTime.Now.Ticks;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a static in c#?

919


What's the difference between an integer and int?

1069


Can a class be protected in c#?

911


What is the resgen.exe tool used for?

985


What are the variables in c#?

946


What is the difference between a private assembly and a shared assembly?

1004


Why we need get set property in c#?

972


What does writeline mean?

983


What is single dimensional array in c#?

938


Are cao stateful in nature?

911


What is a template class?

1017


How to declare a property in a class?

1012


What is the use of generics in c#?

868


What is class sortedlist underneath?

950


What is difference between first and firstordefault?

909