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
What is an array class?
What is wpf c#?
What are c# collections?
What are the differences between value types and reference types?
What is difference between class and interface in c#?
How can I check the type of an object at runtime?
What is a Assembly?
Explain About Web.config
What is literal control
What is for loop in c#?
Why do we use abstract class in c#?
What is difference between list and dictionary in c#?
What is constructors, explain with syntax
Explain manifest & metadata in c#.
How does split work in c#?