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
3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close
Is c# a keyword?
What is lastindexof c#?
What is meaning of type safety in c#?
What is difference between out and ref in c#?
What is a class in unity?
What is default class in c#?
Who benefits from ajax?
What are custom exceptions in C#?
In c#, what will happen if you do not explicitly provide a constructor for a class?
What is the .NET collection class that allows an element to be accessed using a unique key?
Can dictionary have duplicate keys c#?
What is a service layer c#?
What is difference between private and protected in c#?
In which way a two-dimensional array declared in C#?