What is the difference b/w Readonly Variable and Constant
Variable?
Answer Posted / niranjan
The readonly keyword differs 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, although a const field is a compile-
time constant, the readonly field can be used for run-time
constants, as in this line: public static readonly uint l1
= (uint)DateTime.Now.Ticks;
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the difference between .dll extension and .exe extension files?
Is vb.net a programming language?
How to create a constant in vb.net?
How to store images in sql server database through vb.net?
How can we remove handlers at run time?
What is meant by jagged arrays?
What is the use of assembly?
What is the difference between system.applicationexception class and system.systemexception?
What would you do to remove microsoft visual basic name space?
Explain about the ruby interface generator?
Explain about Visual basic.NET culture?
How do you define a read only property in a class module?
What are the technology areas that microsoft.net contains?
How to execute VB.NET PROJECTS,VB6.0 PROJECTS AND write their test cases.Need Reply Urgently
What are the two main parts of .net?