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's the difference between const and readonly ?

Answer Posted / mr vinod kumar

The readonly keyword is different from the const keyword. 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;
What does a character do ?
On most systems, produces a rather annoying beep.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is entity framework advantage?

1092


What is meant by bootstrap in mvc5?

1192


How route table has been created in asp.net mvc?

998


Explain the advantages of asp.net mvc over asp.net?

1124


The order of the filters that get executed, if the multiple filters are implemented?

1033


What are the difference between asynchronous controller implementation between asp.net mvc 3 & asp.net mvc 4?

1102


What are action filters?

1041


What is main objective of asp.net mvc 4 or what is new in mvc4 ?

1135


Is .net core replacing .net framework?

981


What is viewdata?

1032


Explain Bundle.Config in ASP.Net MVC4?

1019


What is the importance of NonActionAttribute?

1062


Explain Keep method in Tempdata in ASP.Net MVC?

1070


How does .net framework works?

1018


Which filter executes first in an asp.net mvc application?

980