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 Posted / 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 View All Answers
How do generics work in c#?
Why data types are important?
What is namespace give the example?
Distinguish between finally and finalize blocks?
What is a three-tier application.
What is windows forms in c#?
In which format you can pass the value in the sleep function?
How do I open the console window?
Do loops in c#?
What is CLR and its application.?
Explain the process of Serialization?
Can we inherit private members of class in c#?
How long will it take to learn c sharp?
What is boolean method?
What is jagged array in c#?