“Method1 hides inherited member Method2. Use the new keyword if hiding was intended” - Compiler Warning
Usually when we compile our C# code, sometimes we see a warning message in output window: Method1 hides inherited member Method2. Use the new keyword if hiding was intended. This warning means that Method1 is declared with the same name as a method in a base class. And the new is not used. This warning informs us that we should use new modifier. using System; namespace abc { public class MyBaseClass { public int i = 1; public DataTable ViewCriteria() { // } } public class MyDerivedClass : MyBaseClass { public void ViewCriteria () // Warning Line Code { // Some New Code For Derived Class } } } Here in above code, since we don't use a new keyword therefore we will face a warning during the code compilation. To remove the warning we need to add a new modifier as shown below. public new void ViewCriteria () // Warning Line Code { // Some New Code For Derived Cla...