Trace the O/p for a program on inheritance and Polymorphism.

3 classes A,B,C

A with two methods

public virtual SomeMethodA

public virtual SomemoreMethodA

B:A
overide virtual SomeMethodA

C:B
new Method SomeMethodA

override SomeMoreMethodA

main method
{
b new instance of B
b.SomeMethodA
b.SomeMoreMethodA

b1 new instance of C
b1.SomeMethodA
b1.SomeMoreMethodA
}



Trace the O/p for a program on inheritance and Polymorphism. 3 classes A,B,C A with two method..

Answer / payal

call B's SomeMethodA
Call A's SomeMoreMethodA
call C's SomeMethodA
call C's SomeMoreMethodA

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

what is IComparable

0 Answers   Wipro,


What is eager and lazy loading in c#?

0 Answers  


Can you inherit multiple abstract classes in c#?

0 Answers  


How many bytes is a char c#?

0 Answers  


write code for Factorial?

6 Answers   Tech Mahindra,






What is the property of class?

0 Answers   Wipro,


Why is it not a good idea to use empty destructors?

0 Answers  


What is a linked list c#?

0 Answers  


What is the diff between the System.Array.CopyTo() and System.Array.Clone()?

0 Answers   Siebel,


What is the difference between func and action delegate?

0 Answers  


What are the benefits of using generics in c#?

0 Answers  


Which control cannot be placed in mdi?

0 Answers  


Categories