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 break mode? What are the options to step through code?
Write a program that would find the nth term of a geometric progression, given the value of first term and common ratio. Any inbuilt function that the language provides for calculating exponent should not be used.
Explain the difference between web.config and machine.config and where it will be ?
What is jagged array in vb.net?
What is the class that allows an element to be accessed using unique key?
Explain what observations between vb.net and vc#.net?
Explain about garbage collection?
So you know which dll is used for microsoft .net run time?
Described strong typing and weak typing?
What is normal jit?
What are jagged arrays ?
Explain about the feature anonymous type?
What is the use of system.diagnostics.process class?
Explain the use of new keyword?
What are jagged arrarys ?