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
Is predicate a functional interface?
how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com
How do I declare a pure virtual function in c#?
What is dictionary and hashtable in c#?
What is private variable?
how to sort an array in c#
What is the default scope of a class in c#?
Explain the difference between a sub and a function in c#.
Is list ienumerable c#?
What are scriptable objects?
What is difference between out and ref in c#?
What is the difference between delegates and superdelegates?
What is this keyword in C#?
When can a derived class override a base class member?
Define sealed classes in c#?