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 an interface class in c#?
Is Facebook a desktop application?
What is data binding c#?
What is thread.sleep()?
Constructor to an arbitrary base constructor?
Why we need get set property in c#?
How more than one version of an assembly can keep in same place?
How to find the current application file path while runtime?
What does dbml mean in texting?
What are the 2 broad classifications of data types available in c#?
Illustrate the differences between the system.array.copyto() and system.array.clone()?
What does async mean in c#?
List the difference between the virtual method and the abstract method?
Is list ienumerable c#?
what happens if you inherit multiple interfaces and they have conflicting method names?