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 difference between const, static and readonly?

Answers were Sorted based on User's Feedback



what is difference between const, static and readonly?..

Answer / magesh

const variable : const can never be modified and
must be initialized to a compile time constant.

Static variable : you received last updated value, when u
getting value for static variable.

Readonly variable : The readonly variable can be changed
inside the constructor.

Is This Answer Correct ?    7 Yes 0 No

what is difference between const, static and readonly?..

Answer / amit manekar

The difference is that static read-only can be modified by
the containing class, but const can never be modified and
must be initialized to a compile time constant. To expand on
the static read-only case a bit, the containing class can
only modify it:

in the variable declaration (through a variable initializer).

in the static constructor (instance constructors if it's not
static).

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

which event in global.asx that fires for every request of same user?

4 Answers   FactorH,


What does assemblyinfo.cs file consist of?

2 Answers   Accenture, HCL,


What are the differences between Dataset and DataReader?

3 Answers   Accenture,


Are there resources online with tips on asp to asp.net conversions?

0 Answers  


Types of caching ?

1 Answers   Digital GlobalSoft, MicroSec, Wipro,


How asp.net mvc differs from asp.net web forms? : asp.net mvc

0 Answers  


What is asp.net architecture?

0 Answers  


Where does the Web page belong in the .NET Framework class hierarchy?

1 Answers  


Which data type does the rangevalidator control support?

0 Answers  


What is role manager work in web.config? how to restrict perticular pages from the users using the role manager?

1 Answers   Patni,


How ViewstateMac works?

0 Answers   CGI,


How to register exception filter globally?

0 Answers  


Categories