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 xslt in c#?
How to use delegates with events?
What is part of a method signature in c#?
What is parameter c#?
Why singleton is sealed?
What is dynamic object in c#?
Can we make a Static Constructor Parameterized? Give Reason with your answer
How many constructor can a class have?
Which controls do not have events?
What are functions in c#?
Define thread? Explain about multithreading?
Can we customize the serialization process?
What does assert() do in c#?
What does immutable mean in c#?
What is the difference between Java and .NET garbage collectors?