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

How do you add a javascript function for a link button in a datagrid?

2 Answers   Microsoft,


Can you edit data in the Repeater control?

4 Answers   Siebel Systems,


How can i include both C# and vb.net classes in same solution?

2 Answers  


what is the difference between server.Transfer and response.redirect in .net

1 Answers  


How connect data into DropDownList from Aceess Table?

1 Answers   HCL, TCS,


Explain current thinking around IClonable.

1 Answers   Infosys, Wipro,


How to use multiple scriptmanager controls in a web page?

0 Answers  


Explain the role of global.asax?

0 Answers  


Explain the difference between debug.write and trace.write?

0 Answers  


Explain difference between dataset and recordset?

0 Answers  


A web service can only be written in .net? State whether true or false.

0 Answers  


what is client-server architecture in .net? and what is 3-tier architecture?

1 Answers  


Categories