Here is my c# class code
public class ConstReadOnly
{
public const int cV = 10;
public readonly int rV = 40;
}
Now when i try to create an instance of this class i'm not getting the const variable cV.What may be the reason.
const are implicitly static, you can access them through class name like:
ConstReadOnly.cV
You may see this post from Jon Skeet - Why can't I use static and const together?