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
windows c# using datagridview in edit form sql server
How to use nullable types in .net?
Why is lazy loading?
Is a games console a computer?
Can non-default constructors be used with single call sao?
Is c# int immutable?
Explain the difference between const and static read-only?
Explain the constructor in c#.
What do you mean by delegates and explain different types of delegates?
Where do we use static class in c#?
What is a constructor in c#?
if a method is marked as protected internal who can access it?
What do you mean by winforms in c#?
How do you access a constant field declared in a class?
In which order the constructor is called for an inherited class?