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
}
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 |
what is IComparable
What is eager and lazy loading in c#?
Can you inherit multiple abstract classes in c#?
How many bytes is a char c#?
write code for Factorial?
What is the property of class?
Why is it not a good idea to use empty destructors?
What is a linked list c#?
What is the diff between the System.Array.CopyTo() and System.Array.Clone()?
What is the difference between func and action delegate?
What are the benefits of using generics in c#?
Which control cannot be placed in mdi?