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
How do you pronounce c#?
Describe the process of “exception handling implementation” in c#?
What is difference between var dynamic and object in c#?
What is dataadapter c#?
Is there an equivalent of exit() for quitting a c# .net application?
Explain About .NET Framework
How to use exception handling in stored procedure?
Is c# queue thread safe?
What is the main usage of keyword “virtual†? How does it work for a method or property?
What are Uses of CLR
What's the difference between a method and a procedure?
How many classes are there in classification?
What is verbatim literal in c#?
What is data bind in c#?
Can a sealed class be used as a base class?