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 / raja

1. we can initialize constant variable only at the
declaration where as readonly varaiable can be initialized
at either declaration or in constructor.

2. we can't use static modifier for the const variable
where as readonly variable can be declared as static

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain more on CLR

1143


What is event sourcing in c#?

970


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

974


Explain use of abstract and sealed classes in c#?

846


What is the adv of using System.Text.StringBuilder over System.String?

965


What is int tryparse in c#?

937


What is int32 maxvalue?

947


What is executenonquery c#?

871


What is type safe in c#?

880


How to put assembly in gac?

898


When should we use sealed class in c#?

889


How long does it take to get a loop recorder put in?

850


What types of object can I throw as exceptions?

930


Can we inherit a class with private constructor in c#?

1044


Can c# inherit multiple classes?

937