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

What is the difference between viewbag and viewdata in mvc?

729


What are ajax helpers in asp.net mvc?

803


How to make sure Client Validation is enabled in ASP.Net MVC

772


How to update one of my table in database at 4pm every day how it is possible?

757


What are the benefits of .net framework?

746


What is the version number for the next version of the .net framework, codenamed �orcas�?

699


What is mapping in entity framework? : Entity framework

704


Possible ways to prevent xss attacks on mvc application?

754


What is namespace of asp.net mvc?

850


Explain the methods used to render the views in mvc?

776


When using razor views, do you have to take any special steps to protect your asp.net mvc application from cross site scripting (xss) attacks?

946


Which are the important namespaces used in mvc?

903


Will the name change be reflected in any of the existing .net framework 2.0 apis, assemblies, or namespaces?

768


What are actions in mvc?

748


I have 2+ years of fake experience,actually i could not answer for project questions..?how can i answer please suggest me..?

2859