Replies |
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Santhiram
Posted on: 4/23/2012 1:36:10 PM
|
Level: Starter | Status: [Member] | Points: 25
|
Readonly fields can be initialized at compile time & runtime also where as const members can be initialized only at compile time.
Thanks
Shanti
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Constant variable once assigned can't be changed, but ReadOnly variable can be changed on the fly.
Regards,
Singaravel M
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Savariya
Posted on: 4/24/2012 2:02:29 AM
|
Level: Starter | Status: [Member] | Points: 25
|
Main Difference between Constant and readonly is that
At the time of declaration you MUST have to define some value for constant variable where as for readonly variable you can definne its value Later(Only in constructor) also
ThANKS
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
Jayakumars
Posted on: 3/23/2013 9:22:00 AM
|
Level: Bronze | Status: [Member] | Points: 25
|
hi
refer this
http://www.aspdotnet-suresh.com/2012/10/cnet-what-is-difference-between-const.html
Mark as Answer if its helpful to you
Regards
Email Id: kumaraspcode2009@gmail.com
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|
VINI1985
Posted on: 3/28/2013 1:27:19 AM
|
Level: Starter | Status: [Member] | Points: 25
|
Whenever declare Constant variable it is mandatory to initialize as well
one more thing with constant can not be static.
Whenever declare readonly variable it is not mandatory to initialize as well
one more thing with constant can be static.
Sekar.C, if this helps please login to Mark As Answer. |
Reply | Alert Moderator
|