Introduction
Constant vs Readonly vs Static Keywords in C#.Constant
By default a constant is static, so you can't define them static from your side.
Readonly
We can also change the value of a Readonly at runtime or assign a value to it at runtime (but in a non-static constructor only).
Static
If we are declare a class as a static class then in this case all the class members must be static too.
The static keyword can be used effectively with classes, fields, operators, events, methods and so on effectively.
Links
C-SharpCorner
Stack Overflow
Comments
Post a Comment