what is the main differnce between const,readonly and static

Answer Posted / komilla shaheen

const is the keyword where we can intialize the variable
with some value which is constant throughout the program it
cannot be changed.
static is the keyword which is intialized at complile time
and had to change at compile time only.
readonly is for the varible which is readonly cant be
changed.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is thread.sleep()?

590


Is null in c#?

570


Can we have multiple constructors in a class c#?

584


How can an inner class access the members of outer class?

618


What is difference between value and reference types in C#.NET

612






Why we use extension method in c#?

595


What does m mean in decimal c#?

569


Why do we use parameters in c#?

588


code for arranging given number in possible permutation ways ex:123,321,312,132,231,213.

1856


What is a Command Object in C#?

636


What is clr namespace?

567


What is namespace in oops?

572


What is the difference between finalize() and dispose()?

575


Why do we use public static void main in c#?

549


How to use reflection to call generic method?

571