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 ?

Answers were Sorted based on User's Feedback



What's the difference between const and readonly ?..

Answer / kirti

You can initialize readonly variables to some runtime values. Let's say your program uses current date and time as one of the values that won't change. This way you declare public readonly string DateT = new DateTime().ToString().

Is This Answer Correct ?    0 Yes 0 No

What's the difference between const and readonly ?..

Answer / 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

More Dot Net Framework Interview Questions

What is mapping in entity framework? : Entity framework

0 Answers  


Describe the roles of clr in .net framework.?

0 Answers  


What is session state management?

0 Answers  


please tell me the best book of asp.net in the markit. which explain in simple and detail.

4 Answers  


What are the methods in Thread class?

3 Answers  


What is renderbody?

0 Answers  


what do you mean by table-per-hierarchy?

0 Answers   Microsoft,


What is side by side Execution ?

3 Answers   MEC, MMTS,


Which is the best institute in hyderabad to learn DotNet?

152 Answers   Cygnet Infotech, Infosys, Student, SVIT, TCS,


How do I install .net framework?

0 Answers  


Can I redirect tracing to a file

1 Answers  


What is CLR and how it generates native code ?

1 Answers   Digital GlobalSoft, Vital Soft,


Categories