Readonly vs. const?

Answers were Sorted based on User's Feedback



Readonly vs. const?..

Answer / pavan

both of them does the same work these value cannot be
changed
but with a samll difference
using const we can assign a value before compile time
but using readonly we can assign value to the varible ones
in runtime

Is This Answer Correct ?    14 Yes 0 No

Readonly vs. const?..

Answer / j_baghla

Both are used for constant values but in readonly variable
we can assign the value thru expression but we can't assign
value to constant variable thru expression.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More Dot Net General Interview Questions

Difference between Panel and GroupBox classes?

3 Answers  


What is DTS and explain the purpose of it?

0 Answers   ADITI,


What is Global Assembly Cache (GAC) and what is the purpose of it?

2 Answers   Ksb,


What are the collections you've used?

0 Answers  


How do you turn off cookies for one page in your site?

3 Answers   Siebel Systems,






State the various features present in .NET?

0 Answers  


Explain the procedure to add assemly to gac to make it shared one?

0 Answers  


What are pdbs?

0 Answers  


Tell about your technical profile ?

0 Answers   TNEB Tamil Nadu Electricity Board,


What is web.config in .net?

0 Answers  


What does the "EnableViewState" property do?

1 Answers  


what is event inheritance and event delegation?

1 Answers  


Categories