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

Explain Model, view and Controllers in Asp.Net MVC?

995


What is the use of razor view engine?

913


What is the use of the default route {resource}.axd/{*pathinfo} ?

961


What are scaffold templates in mvc?

959


What is the difference between adding routes, to a webforms application and to an mvc application?

966


If I have multiple filters implemented, what is the order in which these filters get executed?

882


How we can invoke child actions in ASP.Net MVC?

1052


what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?

2155


Explain covariance and contra-variance in .net framework 4.0. Give an example for each.

957


How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?

882


What is namespace of asp.net mvc?

1069


what is eager loading?

956


What you mean by routing in mvc?

1024


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

1029


Explain the difference between viewbag and viewdata in mvc?

915