What will be the result of the 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
Keep exploring
C# quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes