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 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 Posted / vibz
Call to B's SomeMethodA
Call to A's SomeMoreMethodA
Call to B's SomeMethodA
Call to C's SomeMoreMethodA
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Is python easier than c#?
How do I declare a pure virtual function in c#?
What is definition in c#?
What is strongly typed in c#?
If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.
Why do we need constructor?
What is the use of console readline () in c#?
Can we override constructor in c#?
What is Web.config?
What is difference between private and protected?
Why we use delegates in c#?
What is private virtual in C#?
What is the difference between abstract and abstraction?
Write the difference between TypeOf and GetType?
What is binding in c#?