Difference between constant & read only fields

  • Constants, represented by the const keyword – are fields that remain constant for the life of the application and their value is set at compile-time.
  • When you define a field with the readonly keyword, you have the ability to set that field's value in one place: constructor.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger