What will be the result of a following code execution?
 
abstract class A 
{ 
    public virtual void Method1() 
   { 
       Console.WriteLine ("A.Method1"); 
   } 

    public abstract void Method2(); 
} 

class B:A 
{ 
    public override void Method1()
   { 
       Console.WriteLine("B.Method1");
    } 
} 
class Program 
{ 
     public static void Main(string[] args) 
     {
          A a = new B();
          a.Method1(); 
      } 
}
 

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes