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

If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

2639


Explain Bundle.Config in ASP.Net MVC4?

1057


What is the difference between renderaction and renderpartial?

1196


Explain test driven development (tdd) ?

1069


Name a few different return types of a controller action method?

1192


What is the purpose of a web form?

1064


How does servicing work for the .net framework 3.0?

983


Give an example for authorization filters in an asp.net mvc application?

1028


Explain the 'page lifecycle' of an ASP.NET MVC?

1186


How does servicing work for the .net framework 3.0? If I install the .net framework 3.0, can I get service updates for the .net framework 2.0?

1014


Why we need a separate mobile project template, while we can render our web application in mobile ?

1197


What is ViewData and TempData in ASP.Net MVC?

1077


What is mapping in entity framework? : Entity framework

1042


will there be any issues adding a table without primary keys to a data model?

1151


Is .net core faster than .net framework?

1133