| 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 |
What are the differences between const and readonly ?
Labels: .net, asp.net, c#.net, Differences, vb.net
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment