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 the difference between dynamic and var in c#?

876


Can a class have static constructor?

943


Is array value type in c#?

958


What is xamarin used for?

877


How can I access the registry from c# code?

947


What is difference between ienumerable and list?

925


What are the classes contained in a single .NET DLL ?

875


What is difference between array and arraylist c#?

950


What is variable in c#?

907


Is array ienumerable c#?

822


How do you serialize in c#?

810


Is comparable a functional interface?

842


Explain the three services model (three-tier application). Presentation (ui), business (logic and underlying code) and data (from storage or other sources).

854


what is a enumeration in c#

988


How do you achieve polymorphism in c#?

841