Why do I get warning CS0108 about a property hiding a method from a base class [duplicate]
问题 This question already has answers here : Why is a property hiding Inherited function with same name? (2 answers) Closed 3 years ago . Given the following classes the C# compiler gives me this warning:- CS0108 "'B.Example' hides inherited member 'A.Example(string)'. Use the new keyword if hiding was intended". class A { public string Example(string something) { return something; } } class B : A { public string Example => "B"; } If use the classes running this code class Program { static void