namespace ConsoleApplication1 { class A { public void Amethod() { Console.WriteLine("Amethod"); } } class B : A { public new void Bmethod() { Console.WriteLine("Bmethod"); } } class Program { static void Main() { A ref2 = new B(); ref2.Amethod(); // how here only A class method is accessible ? Please explain B ref3 = new B(); ref3.Amethod(); ref3.Bmethod(); } } }
ref2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)