what is the main differnce between const,readonly and static
Answer Posted / vijay rana
const is used to create a constant value which will be
constant throuout the class
static is used for a commaon variable for all objects, it is
not part of a object, it is a part of class, every object
will share this value,
read,
there are many situation in which we want to intialize the
value of a constat variabl at run time, in which we can have
different values for different objects, with the help of
readonly we can define the value of any object at runtime
which will not be changed later
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Why do we use stringbuilder in c#?
Why do we need indexers in c#?
What is difference between list and ilist in c#?
Explain acid rule of thumb for transactions in c#.
Can arraylist store different data types in c#?
What is executenonquery c#?
What is the difference between field and variable in c#?
What are the various components in crystal reports?
What is c sharp used for?
What is parsing?
Is multilevel inheritance possible in c#?
What is the purpose of dependency injection?
What is the xml document structure?
Is double a decimal?
How do I use the 'using' keyword with multiple objects?