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 concrete class in c#?

476


What is a delegate how is it type safe?

469


How to transpose multi-dimensional array?

562


What are extension methods and where can we use them?

460


Which string method is used for concatenation of two strings in c#?

475






What are the advantages of interface in c#?

504


What's the difference between an integer and int?

538


Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.

3804


Is object an int c#?

527


Is array ienumerable c#?

471


Explain About Web.config

564


What is a sealed class?

515


What is a strong name in c#?

815


What is uint c#?

456


What are extensions in c#?

540