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

What are use of Cloud computing....?

1 Answers   CTS,


What is il and c#?

0 Answers  


Explain about .net?

0 Answers  


What are pdbs?

0 Answers  


why do you want to join deloitte, where do you exactly fit in.

1 Answers   Deloitte,






What does mean by .net framework?

0 Answers  


How many types of transactions are there in com + .net ?

0 Answers  


What are the namespace available in .net?

0 Answers  


Tell us what is a sealed class?

0 Answers  


How can you automatically generate interface for the remotable object in .NET with Microsoft tools?

1 Answers  


Please explain is the jit an interpreter?

0 Answers  


What is STA in .NET?

0 Answers  


Categories