In the following code what is difference between Field1 and Field2 variables, both can be accessed in static way.
public static class FieldName { public static const string Field1 = "Field1"; public const string Field2 = "Field2"; }
Thanks,
Amit
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
error CS0504: The constant 'FieldName.Field1' cannot be marked static.Source: http://blogs.msdn.com/b/csharpfaq/archive/2004/03/12/why-can-t-i-use-code-static-code-and-code-const-code-together.aspx