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...


Difference Between ReadOnly and Constant Variable in
compile time and Run Time.

Answers were Sorted based on User's Feedback



Difference Between ReadOnly and Constant Variable in compile time and Run Time...

Answer / karna

I am adding another point to the above answer.

as the constant variable is constant over the class,that
means,all the objects created for that class have the same
value.
but in case of readonly variables,we can assign different
values in the different instances of the class it contains.

Is This Answer Correct ?    6 Yes 0 No

Difference Between ReadOnly and Constant Variable in compile time and Run Time...

Answer / kamlesh sharma

readonly variables are can be initilized at compile time
but we can assign values to readonly varialble at once
through functions or constructors

but in case of constant variables once assign a value we
can't change value and must assign value to constant
variables at the time of declarition

Is This Answer Correct ?    5 Yes 1 No

Difference Between ReadOnly and Constant Variable in compile time and Run Time...

Answer / saiish bhat

readonly is compile time constant.
constant is runtime constant.

constatnt field is used to initialize at the declaration of
the field.
readonly field is used at the declaration or constructor of
the field.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More ASP.NET Interview Questions

How will u decide when to use caching and when to use viewstate?

5 Answers  


What is viewstate?

5 Answers   Microsoft,


If i have 1000 records in dataset, how to do paging?

2 Answers   Mind Tree,


What is a WebService and what is the underlying protocol used in it? Namespace?

1 Answers  


What are the different methods that are used during the page load?

1 Answers   Siebel,


Which methods validate all the controls on a page?

0 Answers  


How does the regular expression validator work? What are two situations when you might want to use one?

2 Answers  


Describe paging in asp.net?

0 Answers  


Which is faster viewdata or viewbag?

0 Answers  


what is manifest?

3 Answers   Airtel, Microsoft,


Explain Authentication mechanism in dotnet

0 Answers   BirlaSoft,


2. Why did you choose this career?

2 Answers   Schwartz Oil, Swatz Oils,


Categories