thanks for ur answer,i tried but its not working.... sravani p
S
sravani p
@sravani p
Posts
-
waht exactly the use of new keyword in c# -
waht exactly the use of new keyword in c#heloo.... i want to hide the base class method using new operator. i tried this code.but it was not working.here base class method is calling. plz help me soon. using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication23 { class Program:user { public new void print() { Console.WriteLine("hello how are you?"); } static void Main(string[] args) { user u = new Program(); u.print(); Console.ReadLine(); } } class user { public void print() { Console.WriteLine("hellohello"); } } } sravani.p