No matter what I Google, there doesn’t seem to be an answer for this! In a C# class, what does the new keyword do to a const field?
e.g:
private const int ConstOne = 0;
private new const int ConstTwo = 0;
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.
The
newkeyword is used when hiding a member from a base class.It doesn’t actually do anything; it just tells the compiler not to warn you that you’re hiding the base field.
See the documentation