Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a lambda expression in c#?

1626


What is the reason behind the invention of c#?

1197


Is xml tags are case sensitive?

937


What are the basics of c#?

1114


What's difference between constants and static readonly?

1261


What is a deadlock lock?

972


What does mean before a string in c#?

1093


Which is better interface or abstract class in c#?

864


What is an actual parameter?

1021


What is the difference between class and namespace?

1021


if you do have a stack overflow profile.what is your ranking?

1925


What do you use c# for?

962


Is a decimal an integer?

928


Why delegates are type safe in c#?

930


What is a c# delegate?

1128