What's the difference between const and readonly ?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do I need microsoft .net framework?

566


What are scaffold templates in mvc?

594


What is representational state transfer (rest) mean?

563


What are Non Action methods in ASP.Net MVC?

601


What are html helpers in asp.net mvc?

565






What are action filters?

612


Is .net framework backwards compatible?

618


What is a razor file?

535


Can you explain model, controller and view in mvc?

577


What are the 3 main components of an asp.net mvc application?

549


What is renderbody?

554


Is razor a server side?

536


How we can handle the exception at controller level in ASP.Net MVC?

585


Explain test driven development (tdd) ?

574


What you mean by routing in asp.net mvc?

551