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 does my windows application pop up a console window every time I run it?
Name which controls do not have events?
What is autopostback in c#?
Is c# and .net same?
Can you have parameters for static constructors?
What is object type in c#?
What does int parse do in c#?
What is hierarchical inheritance in c#?
What is the adv of using System.Text.StringBuilder over System.String?
What is the use of generics in c#?
What is different about switch statements in c#?
What are sessions in c#?
Where do we set the min and max pool size for connection pooling?
What is difference between array and list?
What is a multicast delegate in c#?