What are the differences between const and readonly ?

Wednesday, July 8, 2009

























Sno
const
readonly
1 Can't be static. Can be instance level or static
2 evaluated at design time evaluated at run time
3
Initialized at declaration

Initialized at declaration and in constructor
4
must be of integral type or enumeration
In addition it can have complex types with new keyword and
enumerations are not allowed


www.codecollege.NET

0 comments

Post a Comment

LinkWithin

Blog Widget by LinkWithin

Recommended Books